aboutsummaryrefslogtreecommitdiff
path: root/bot/tests
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-24 19:37:23 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-24 19:37:23 +0200
commit4430af0e8a05b3424b88ee9803034959b5e46dec (patch)
tree5bac063f10d037fef5934c8e25e6ba6bd7acb8f5 /bot/tests
parentSend timelimits to bot (diff)
downloadcouncil-webapp-4430af0e8a05b3424b88ee9803034959b5e46dec.tar.gz
council-webapp-4430af0e8a05b3424b88ee9803034959b5e46dec.tar.bz2
council-webapp-4430af0e8a05b3424b88ee9803034959b5e46dec.zip
Bot receives reminders from webapp
Diffstat (limited to 'bot/tests')
-rw-r--r--bot/tests/run_test.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/bot/tests/run_test.py b/bot/tests/run_test.py
index e3a9030..e22516b 100644
--- a/bot/tests/run_test.py
+++ b/bot/tests/run_test.py
@@ -344,7 +344,7 @@ class MeetBotTest(unittest.TestCase):
def get_simple_agenda_test(self):
test = test_meeting.TestMeeting()
test.set_voters(['x', 'z'])
- test.set_agenda([['first item', ['opt1', 'opt2']], ['second item', []]])
+ test.set_agenda([['first item', ['opt1', 'opt2'], ''], ['second item', [], '']])
test.M.config.manage_agenda = False
test.answer_should_match("20:13:50 <x> #startmeeting",
@@ -483,6 +483,23 @@ class MeetBotTest(unittest.TestCase):
test.answer_should_match('20:13:50 <x> #timelimit list',
'Set reminders: "' + '", "'.join(keys) + '"')
+ def test_preset_agenda_time_limits(self):
+ test = self.get_simple_agenda_test()
+ test.M.config.agenda._agenda[0][2] = '1:0 message'
+ test.M.config.agenda._agenda[1][2] = '1:0 another message\n0:10 some other message'
+
+ test.process('20:13:50 <x> #nextitem')
+ keys = test.M.config.agenda.reminders.keys()
+ keys.sort()
+ assert(keys == ['another message', 'some other message'])
+
+ test.process('20:13:50 <x> #previtem')
+ keys = test.M.config.agenda.reminders.keys()
+ keys.sort()
+ assert(keys == ['message'])
+
+ test.process('20:13:50 <x> #nextitem')
+
if __name__ == '__main__':
os.chdir(os.path.join(os.path.dirname(__file__), '.'))