test_bots: Add stream is not None asserts.

This commit is contained in:
Tim Abbott 2017-03-19 21:26:12 -07:00
parent e2eeef5118
commit 81194df65d
1 changed files with 5 additions and 0 deletions

View File

@ -226,6 +226,7 @@ class BotTest(ZulipTestCase):
self.login("hamlet@zulip.com") self.login("hamlet@zulip.com")
user_profile = get_user_profile_by_email("hamlet@zulip.com") user_profile = get_user_profile_by_email("hamlet@zulip.com")
stream = get_stream("Denmark", user_profile.realm) stream = get_stream("Denmark", user_profile.realm)
assert stream is not None
self.subscribe_to_stream(user_profile.email, stream.name) self.subscribe_to_stream(user_profile.email, stream.name)
do_change_stream_invite_only(stream, True) do_change_stream_invite_only(stream, True)
@ -264,6 +265,7 @@ class BotTest(ZulipTestCase):
self.login("hamlet@zulip.com") self.login("hamlet@zulip.com")
user_profile = get_user_profile_by_email("hamlet@zulip.com") user_profile = get_user_profile_by_email("hamlet@zulip.com")
stream = get_stream("Denmark", user_profile.realm) stream = get_stream("Denmark", user_profile.realm)
assert stream is not None
self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark") self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark")
do_change_stream_invite_only(stream, True) do_change_stream_invite_only(stream, True)
@ -328,6 +330,7 @@ class BotTest(ZulipTestCase):
self.login("hamlet@zulip.com") self.login("hamlet@zulip.com")
user_profile = get_user_profile_by_email("hamlet@zulip.com") user_profile = get_user_profile_by_email("hamlet@zulip.com")
stream = get_stream("Denmark", user_profile.realm) stream = get_stream("Denmark", user_profile.realm)
assert stream is not None
self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark") self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark")
do_change_stream_invite_only(stream, True) do_change_stream_invite_only(stream, True)
@ -625,6 +628,7 @@ class BotTest(ZulipTestCase):
self.login("hamlet@zulip.com") self.login("hamlet@zulip.com")
user_profile = get_user_profile_by_email("hamlet@zulip.com") user_profile = get_user_profile_by_email("hamlet@zulip.com")
stream = get_stream("Denmark", user_profile.realm) stream = get_stream("Denmark", user_profile.realm)
assert stream is not None
self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark") self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark")
do_change_stream_invite_only(stream, True) do_change_stream_invite_only(stream, True)
@ -707,6 +711,7 @@ class BotTest(ZulipTestCase):
self.login("hamlet@zulip.com") self.login("hamlet@zulip.com")
user_profile = get_user_profile_by_email("hamlet@zulip.com") user_profile = get_user_profile_by_email("hamlet@zulip.com")
stream = get_stream("Denmark", user_profile.realm) stream = get_stream("Denmark", user_profile.realm)
assert stream is not None
self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark") self.unsubscribe_from_stream("hamlet@zulip.com", "Denmark")
do_change_stream_invite_only(stream, True) do_change_stream_invite_only(stream, True)