コード例 #1
0
ファイル: basic.py プロジェクト: marthagb/voting
 def test_apportionment_sainte_lague(self):
     votes = [501.0, 400.0]
     num_seats = 5
     prior_allocations = [1, 1]
     res = apportion1d(votes, num_seats, prior_allocations,
                       sainte_lague_gen)
     self.assertEqual(res[0], [3, 2])
コード例 #2
0
ファイル: tests.py プロジェクト: busla/voting
 def test_apportionment_dhondt(self):
     votes = [301.0, 200.0]
     num_seats = 5
     prior_allocations = [1, 1]
     res = apportion1d(votes, num_seats, prior_allocations, dhondt_gen)
     self.assertEqual(res[0], [3, 2])