mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
tests: Assert num_events in tornado_redirected_to_list.
This commit is contained in:
committed by
Tim Abbott
parent
8960e64443
commit
481a890ec5
@@ -166,7 +166,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
self.login("hamlet")
|
||||
self.assert_num_bots_equal(0)
|
||||
events: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events):
|
||||
with self.tornado_redirected_to_list(events, expected_num_events=2):
|
||||
result = self.create_bot()
|
||||
self.assert_num_bots_equal(1)
|
||||
|
||||
@@ -332,7 +332,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
self.login_user(user)
|
||||
self.assert_num_bots_equal(0)
|
||||
events: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events):
|
||||
with self.tornado_redirected_to_list(events, expected_num_events=2):
|
||||
result = self.create_bot()
|
||||
self.assert_num_bots_equal(1)
|
||||
|
||||
@@ -386,7 +386,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
"principals": '["' + iago.email + '"]',
|
||||
}
|
||||
events: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events):
|
||||
with self.tornado_redirected_to_list(events, expected_num_events=3):
|
||||
result = self.common_subscribe_to_streams(hamlet, ["Rome"], request_data)
|
||||
self.assert_json_success(result)
|
||||
|
||||
@@ -403,7 +403,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
"principals": '["hambot-bot@zulip.testserver"]',
|
||||
}
|
||||
events_bot: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events_bot):
|
||||
with self.tornado_redirected_to_list(events_bot, expected_num_events=2):
|
||||
result = self.common_subscribe_to_streams(hamlet, ["Rome"], bot_request_data)
|
||||
self.assert_json_success(result)
|
||||
|
||||
@@ -424,7 +424,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
|
||||
self.assert_num_bots_equal(0)
|
||||
events: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events):
|
||||
with self.tornado_redirected_to_list(events, expected_num_events=2):
|
||||
result = self.create_bot(default_sending_stream="Denmark")
|
||||
self.assert_num_bots_equal(1)
|
||||
self.assertEqual(result["default_sending_stream"], "Denmark")
|
||||
@@ -496,7 +496,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
|
||||
|
||||
self.assert_num_bots_equal(0)
|
||||
events: List[Mapping[str, Any]] = []
|
||||
with self.tornado_redirected_to_list(events):
|
||||
with self.tornado_redirected_to_list(events, expected_num_events=2):
|
||||
result = self.create_bot(default_events_register_stream="Denmark")
|
||||
self.assert_num_bots_equal(1)
|
||||
self.assertEqual(result["default_events_register_stream"], "Denmark")
|
||||
|
||||
Reference in New Issue
Block a user