coverage: Bring test_events to 100% coverage.

This commit is contained in:
Tim Abbott 2017-03-04 23:12:19 -08:00
parent d4f0e394e9
commit 768307d921
2 changed files with 3 additions and 4 deletions

View File

@ -86,7 +86,6 @@ not_yet_fully_covered = {
'zerver/tests/test_bugdown.py', 'zerver/tests/test_bugdown.py',
'zerver/tests/test_decorators.py', 'zerver/tests/test_decorators.py',
'zerver/tests/test_email_mirror.py', 'zerver/tests/test_email_mirror.py',
'zerver/tests/test_events.py',
'zerver/tests/test_narrow.py', 'zerver/tests/test_narrow.py',
'zerver/tests/test_templates.py', 'zerver/tests/test_templates.py',
'zerver/tests/test_tornado.py', 'zerver/tests/test_tornado.py',

View File

@ -306,11 +306,11 @@ class EventsRegisterTest(ZulipTestCase):
if state_change_expected: if state_change_expected:
if before == after: if before == after:
print(events) print(events) # nocoverage
raise Exception('Test does not exercise enough code -- events do not change state.') raise AssertionError('Test does not exercise enough code -- events do not change state.')
else: else:
if before != after: if before != after:
raise Exception('Test is invalid--state actually does change here.') raise AssertionError('Test is invalid--state actually does change here.')
normal_state = fetch_initial_state_data(self.user_profile, event_types, "", include_subscribers=include_subscribers) normal_state = fetch_initial_state_data(self.user_profile, event_types, "", include_subscribers=include_subscribers)
self.match_states(hybrid_state, normal_state) self.match_states(hybrid_state, normal_state)