openelections / openelections-data-wi

Pre-processed election results for Wisconsin elections
9 stars 9 forks source link

Add district field to tests #42

Closed davipo closed 5 years ago

davipo commented 6 years ago

We should be testing the district field. It contains a district number for House, Court of Appeals, State Senate, and State Assembly offices.

Also, without the district field, it is difficult to find the data for a (failed) test, because the data is ordered by office, which (in the input) includes the district.

nbdavies commented 6 years ago

This branch: https://github.com/nbdavies/openelections-data-wi/tree/test-districts

...has a couple of the pieces necessary:

davipo commented 6 years ago

This branch: https://github.com/davipo/openelections-data-wi/tree/dp-add-district-to-tests

... has an updated format_feature_test.py that handles the district field. (This command-line script converts CSV test data to and from .feature format. Give it a --help arg for usage info.)

It also includes the CSV test data Nick edited to add district data, and that data converted to .feature format (wi-elections_with_districts.feature). https://github.com/davipo/openelections-data-wi/tree/dp-add-district-to-tests/tests/features

davipo commented 6 years ago

Tests with district field moved to wi-elections.feature and wi-elections.feature.csv

nbdavies commented 6 years ago

steps.py compares district column in the test file to the actual CSV output

The rest of the parts needed for this to work are in https://github.com/davipo/openelections-data-wi/pull/19.

We could also have the parser know which offices get a district and which don't, and halt or warn if the output data is going to be incorrect.

davipo commented 5 years ago

Got various branches merged on Nov 10, tests passed. I'll create a new issue for having the parser check presence versus absence of district data.

davipo commented 5 years ago

Issue for parser checking district is #46.