Skip to content

Commit

Permalink
test dominion v5.17 accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Jun 27, 2023
1 parent d6eff1a commit 3cb178d
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rcvformats/test/testconversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,22 @@ def test_electionbuddy_conversion_accurate():
_assert_conversion_correct(file_in, file_out, converter)


def test_dominion_conversion_accurate():
def test_dominion_old_conversion_accurate():
""" Converts dominion_xlsx XLSX to the standard format """
file_in = 'testdata/inputs/dominion_xlsx/las-cruces-mayor.xlsx'
file_out = 'testdata/conversions/from-dominion.json'
converter = dominion_xlsx.DominionXlsxConverter()
_assert_conversion_correct(file_in, file_out, converter)


def test_dominion_v5_17_conversion_accurate():
""" Converts dominion_xlsx XLSX to the standard format """
file_in = 'testdata/inputs/dominion_xlsx/v5_17_multi.xlsx'
file_out = 'testdata/conversions/from-dominion-v5-17.json'
converter = dominion_xlsx.DominionXlsxConverter()
_assert_conversion_correct(file_in, file_out, converter)


def test_dominion_txt():
""" Converts dominion_txt TXT file to the standard format """
file_in = 'testdata/inputs/dominion.txt'
Expand Down
109 changes: 109 additions & 0 deletions testdata/conversions/from-dominion-v5-17.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"config": {
"date": "2023-11-07",
"contest": "Best Ice Cream Flavor",
"office": "Best Ice Cream Flavor",
"threshold": 145
},
"results": [
{
"round": 1,
"tally": {
"Vanilla": 90,
"Chocolate": 72,
"Strawberry": 72,
"Neapolitan": 0,
"Rainbow Sherbet": 18,
"Chocolate Chip": 36,
"Butter Pecan": 0,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"eliminated": "Neapolitan"
}
]
},
{
"round": 2,
"tally": {
"Vanilla": 90,
"Chocolate": 72,
"Strawberry": 72,
"Rainbow Sherbet": 18,
"Chocolate Chip": 36,
"Butter Pecan": 0,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"eliminated": "Butter Pecan"
}
]
},
{
"round": 3,
"tally": {
"Vanilla": 90,
"Chocolate": 72,
"Strawberry": 72,
"Rainbow Sherbet": 18,
"Chocolate Chip": 36,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"eliminated": "Rainbow Sherbet"
}
]
},
{
"round": 4,
"tally": {
"Vanilla": 90,
"Chocolate": 72,
"Strawberry": 72,
"Chocolate Chip": 54,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"eliminated": "Chocolate Chip"
}
]
},
{
"round": 5,
"tally": {
"Vanilla": 126,
"Chocolate": 72,
"Strawberry": 90,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"eliminated": "Chocolate"
}
]
},
{
"round": 6,
"tally": {
"Vanilla": 126,
"Strawberry": 162,
"Write-in": 0,
"Inactive Ballots": 0
},
"tallyResults": [
{
"elected": "Strawberry"
}
]
}
]
}

0 comments on commit 3cb178d

Please sign in to comment.