coverage: Bring zerver.lib.narrow.py to 100% coverage.

This commit is contained in:
Tim Abbott 2017-03-04 23:56:57 -08:00
parent 56b1f79fe3
commit e3cfb256dd
2 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,6 @@ not_yet_fully_covered = {
'zerver/lib/events.py',
'zerver/lib/i18n.py',
'zerver/lib/message.py',
'zerver/lib/narrow.py',
'zerver/lib/notifications.py',
'zerver/lib/push_notifications.py',
'zerver/lib/request.py',

View File

@ -21,6 +21,7 @@ from zerver.lib.message import (
from zerver.lib.narrow import (
build_narrow_filter,
)
from zerver.lib.request import JsonableError
from zerver.lib.str_utils import force_bytes
from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection
from zerver.lib.test_helpers import (
@ -342,6 +343,11 @@ class BuildNarrowFilterTest(TestCase):
for e in reject_events:
self.assertFalse(narrow_filter(e))
def test_build_narrow_filter_invalid(self):
# type: () -> None
with self.assertRaises(JsonableError):
build_narrow_filter(["invalid_operator", "operand"])
class IncludeHistoryTest(ZulipTestCase):
def test_ok_to_include_history(self):
# type: () -> None