aboutsummaryrefslogtreecommitdiff
path: root/bot/tests
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-21 17:29:09 +0200
committerPetteri R├Ąty <petsku@petteriraty.eu>2011-06-22 10:22:05 +0300
commit1a137e470619a11e14ed9c0be48f24a062890d1b (patch)
tree7006471a74483de81f600b1c029580e11656298f /bot/tests
parentShell script to run all tests (diff)
downloadcouncil-webapp-1a137e470619a11e14ed9c0be48f24a062890d1b.tar.gz
council-webapp-1a137e470619a11e14ed9c0be48f24a062890d1b.tar.bz2
council-webapp-1a137e470619a11e14ed9c0be48f24a062890d1b.zip
Close voting when last user allowed to vote voted.
Diffstat (limited to 'bot/tests')
-rw-r--r--bot/tests/run_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bot/tests/run_test.py b/bot/tests/run_test.py
index 9808ee6..3c43fef 100644
--- a/bot/tests/run_test.py
+++ b/bot/tests/run_test.py
@@ -406,6 +406,7 @@ class MeetBotTest(unittest.TestCase):
def test_agenda_voting(self):
test = self.get_simple_agenda_test()
+ test.M.config.agenda._voters.append('t')
test.answer_should_match('20:13:50 <x> #startvote', 'Voting started\. ' +\
'Available voting options are:\n0. opt1\n1. opt2\nVote ' +\
'#vote <option number>.\nEnd voting with #endvote.')
@@ -427,6 +428,16 @@ class MeetBotTest(unittest.TestCase):
assert(test.votes() == {'first item': {u'x': 'opt2', u'z': 'opt1'}, 'second item': {}})
+ def test_agenda_close_voting_after_last_vote(self):
+ test = self.get_simple_agenda_test()
+ test.answer_should_match('20:13:50 <x> #startvote', 'Voting started\. ' +\
+ 'Available voting options are:\n0. opt1\n1. opt2\nVote ' +\
+ '#vote <option number>.\nEnd voting with #endvote.')
+ test.answer_should_match('20:13:50 <x> #startvote', 'Voting is already open. ' +\
+ 'You can end it with #endvote.')
+ test.answer_should_match('20:13:50 <x> #vote 0', 'You voted for #0 - opt1')
+ test.answer_should_match('20:13:50 <z> #vote 0', 'You voted for #0 - opt1. Voting closed.')
+
if __name__ == '__main__':
os.chdir(os.path.join(os.path.dirname(__file__), '.'))