From 92d78d0a23957eb8874f0c14fca78af8784881ef Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Mon, 3 Apr 2023 13:47:55 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=E2=99=BB=EF=B8=8F=20=20Update=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_voting.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/test_voting.py b/test/test_voting.py index 0162cc1..d98d784 100644 --- a/test/test_voting.py +++ b/test/test_voting.py @@ -16,17 +16,17 @@ class TestVoter(unittest.TestCase): Voting(title="Test", quorum=Quorum(), voters=['a']) def test_vote_before_end(self): - self.voting.vote(voter='a', vote=Vote.YES) + self.voting.vote(voter='a', vote=Vote.JA) def test_vote_after_end(self): self.voting.days = 0 - self.assertRaises(RuntimeError, self.voting.vote, voter='a', vote=Vote.YES) + self.assertRaises(RuntimeError, self.voting.vote, voter='a', vote=Vote.JA) def test_unknown_voter(self): - self.assertRaises(ValueError, self.voting.vote, voter='z', vote=Vote.YES) + self.assertRaises(ValueError, self.voting.vote, voter='z', vote=Vote.JA) def test_known_voter(self): - self.voting.vote('a', Vote.YES) + self.voting.vote('a', Vote.JA) class TestResult(unittest.TestCase): @@ -46,23 +46,23 @@ class TestResult(unittest.TestCase): assert res['voting']['start'] == self.timestamp assert res['voting']['days'] == 7 assert res['voting']['votes'] == {} - assert res['votes'] == {'YES': 0, 'NO': 0, 'ABSTENTION': 0} + assert res['votes'] == {'JA': 0, 'NEIN': 0, 'ENTHALTUNG': 0} assert res['quorum_reached'] == True def test_result_data_with_votes(self): - self.voting.vote(voter='a', vote=Vote.YES) + self.voting.vote(voter='a', vote=Vote.JA) res = self.result.result() - assert res['voting']['votes'] == {'a': 'YES'} - assert res['votes'] == {'YES': 1, 'NO': 0, 'ABSTENTION': 0} + assert res['voting']['votes'] == {'a': 'JA'} + assert res['votes'] == {'JA': 1, 'NEIN': 0, 'ENTHALTUNG': 0} def test_result_data_with_outcome_accept(self): - self.voting.vote(voter='a', vote=Vote.YES) + self.voting.vote(voter='a', vote=Vote.JA) self.voting.days = 0 res = self.result.result() assert res['state'] == 'ANGENOMMEN' def test_result_data_with_outcome_declined(self): - self.voting.vote(voter='a', vote=Vote.NO) + self.voting.vote(voter='a', vote=Vote.NEIN) self.voting.days = 0 res = self.result.result() assert res['state'] == 'ABGELEHNT'