def main():
    fname = 'fake_va_elec_results.csv'
    path = join(dirname(dirname(abspath(__file__))), fname)
    download_results(path)
    results = parse_and_clean(path)
    summary = summarize(results)
    write_csv(summary)
def main():
    fname = 'fake_va_elec_results.csv'
    path = join(dirname(dirname(__file__)), fname)
    download_results(path)
    results = parse_and_clean(path)
    summary = summarize(results)
    write_csv(summary)
Example #3
0
 def test_name_parsing(self):
     "Parser should split full candidate name into first and last names"
     path = join(dirname(__file__), 'sample_results.csv')
     results = parse_and_clean(path)
     race_key = 'President'
     cand_key = 'GOP-Smith, Joe'
     # Get one county result
     smith = results[race_key][cand_key][0]
     self.assertEqual(smith['first_name'], 'Joe')
     self.assertEqual(smith['last_name'], 'Smith')
Example #4
0
 def test_name_parsing(self):
     "Parser should split full candidate name into first and last names"
     path = join(dirname(__file__), 'sample_results.csv')
     results = parse_and_clean(path)
     race_key = 'President'
     cand_key = 'GOP-Smith, Joe'
     # Get one county result
     smith = results[race_key][cand_key][0]
     self.assertEqual(smith['first_name'], 'Joe')
     self.assertEqual(smith['last_name'], 'Smith')