def test_parse_office(self):
        office_district = [
            "Attorney General",
            "Auditor of State",
            "Governor and Lieutenant Governor",
            "Secretary of Agriculture",
            "Secretary of State",
            "Treasurer of State",
            ("State Representative District 058", "State Representative", "058"),
            ("State Senator District 29", "State Senator", "29"),
            ("United States Representative District 5",
             "United States Representative", "5"),
        ]

        for office in office_district:
            try:
                office_in, expected_office, expected_district = office
            except __HOLE__:
                office_in = office
                expected_office = office
                expected_district = None

            office_out, district = self.loader._parse_office(office_in)
            self.assertEqual(office_out, expected_office)
            self.assertEqual(district, expected_district)
dataset/ETHPy150Open openelections/openelections-core/openelex/tests/test_ia_loader.py/TestExcelPrecinctPre2010ResultLoader.test_parse_office