@@ -299,6 +299,13 @@ def test_compute_risk(contests):
299
299
("cand1" , "cand2" ): 0.000561 ,
300
300
("cand1" , "cand3" ): 0 ,
301
301
},
302
+ "test_ga_presidential" : {
303
+ ("Biden" , "Trump" ): 2.035688053599178e-09 ,
304
+ ("Biden" , "Jorgensen" ): 0.0 ,
305
+ ("Biden" , "Write-in" ): 0.0 ,
306
+ ("Biden" , "Overvote" ): 0.0 ,
307
+ ("Biden" , "Undervote/Blank" ): 0.0 ,
308
+ },
302
309
}
303
310
304
311
expected_decisions = {
@@ -315,6 +322,7 @@ def test_compute_risk(contests):
315
322
"test11" : False ,
316
323
"test12" : True ,
317
324
"test_small_third_candidate" : True ,
325
+ "test_ga_presidential" : True ,
318
326
}
319
327
320
328
for contest in contests .values ():
@@ -353,6 +361,13 @@ def test_compute_risk_empty(contests):
353
361
"test11" : {("cand1" , "cand2" ): 1 ,},
354
362
"test12" : {("cand1" , "cand2" ): 1 , ("cand1" , "cand3" ): 1 ,},
355
363
"test_small_third_candidate" : {("cand1" , "cand2" ): 1 , ("cand1" , "cand3" ): 1 ,},
364
+ "test_ga_presidential" : {
365
+ ("Biden" , "Trump" ): 1 ,
366
+ ("Biden" , "Jorgensen" ): 1 ,
367
+ ("Biden" , "Write-in" ): 1 ,
368
+ ("Biden" , "Overvote" ): 1 ,
369
+ ("Biden" , "Undervote/Blank" ): 1 ,
370
+ },
356
371
}
357
372
358
373
expected_decisions = {
@@ -369,6 +384,7 @@ def test_compute_risk_empty(contests):
369
384
"test11" : False ,
370
385
"test12" : False ,
371
386
"test_small_third_candidate" : False ,
387
+ "test_ga_presidential" : False ,
372
388
}
373
389
374
390
for contest in contests .values ():
@@ -513,6 +529,17 @@ def test_tied_contest():
513
529
"votesAllowed" : 1 ,
514
530
"numWinners" : 1 ,
515
531
},
532
+ "test_ga_presidential" : {
533
+ "Trump" : 2457924 ,
534
+ "Biden" : 2471981 ,
535
+ "Jorgensen" : 62058 ,
536
+ "Write-in" : 457 ,
537
+ "Overvote" : 0 ,
538
+ "Undervote/Blank" : 0 ,
539
+ "ballots" : 4992420 ,
540
+ "votesAllowed" : 1 ,
541
+ "numWinners" : 1 ,
542
+ },
516
543
}
517
544
518
545
# Useful test data
@@ -530,6 +557,7 @@ def test_tied_contest():
530
557
"test11" : None ,
531
558
"test12" : None ,
532
559
"test_small_third_candidate" : None ,
560
+ "test_ga_presidential" : None ,
533
561
}
534
562
535
563
round1_sample_results = {
@@ -548,6 +576,16 @@ def test_tied_contest():
548
576
"test_small_third_candidate" : {
549
577
"round1" : {"cand1" : 1200 , "cand2" : 1000 , "cand3" : 10 }
550
578
},
579
+ "test_ga_presidential" : {
580
+ "round1" : {
581
+ "Trump" : 2457924 ,
582
+ "Biden" : 2471971 , # Take 10 away to make the sample "fewer" ballots
583
+ "Jorgensen" : 62058 ,
584
+ "Write-in" : 457 ,
585
+ "Overvote" : 0 ,
586
+ "Undervote/Blank" : 0 ,
587
+ }
588
+ },
551
589
}
552
590
553
591
true_sample_sizes = {
@@ -594,4 +632,10 @@ def test_tied_contest():
594
632
"0.8" : {"type" : None , "size" : 3760 , "prob" : 0.8 },
595
633
"0.9" : {"type" : None , "size" : 5426 , "prob" : 0.9 },
596
634
},
635
+ "test_ga_presidential" : {
636
+ "asn" : {"type" : "ASN" , "size" : 573956 , "prob" : 0.5 },
637
+ "0.7" : {"type" : None , "size" : 930691 , "prob" : 0.7 },
638
+ "0.8" : {"type" : None , "size" : 1233334 , "prob" : 0.8 },
639
+ "0.9" : {"type" : None , "size" : 1780697 , "prob" : 0.9 },
640
+ },
597
641
}
0 commit comments