def test_party_seats_1_riding_2_party_tie() -> None: """Test party_seats for two tied party in 1 riding""" e = Election(date(2000, 2, 8)) e.update_results('r1', 'ndp', 20) e.update_results('r1', 'np', 20) res1 = e.party_seats() assert res1 == {'ndp': 0, 'np': 0}
def test_party_seats_2_riding_2_party() -> None: """Test party_seats for 2 riding and 2 party""" e = Election(date(2000, 2, 8)) e.update_results('r1', 'ndp', 19) e.update_results('r2', 'np', 69) res1 = e.party_seats() assert res1 == {'ndp': 1, 'np': 1}
def test_party_seats_0_votes() -> None: """Test party_seats for each party has 0 votes""" e = Election(date(2000, 2, 8)) e.update_results('r1', 'ndp', 0) e.update_results('r2', 'np', 1) res1 = e.party_seats() assert res1 == {'ndp': 0, 'np': 1}
def test_party_seats_1_riding_1_party() -> None: """Test party_seats for 1 riding and 1 party""" e = Election(date(2000, 2, 8)) e.update_results('r1', 'ndp', 19) res1 = e.party_seats() assert res1 == {'ndp': 1}