mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
coverage: bring zerver/lib/request.py to 100% coverage.
This commit is contained in:
@@ -77,7 +77,6 @@ not_yet_fully_covered = {
|
|||||||
'zerver/lib/message.py',
|
'zerver/lib/message.py',
|
||||||
'zerver/lib/notifications.py',
|
'zerver/lib/notifications.py',
|
||||||
'zerver/lib/push_notifications.py',
|
'zerver/lib/push_notifications.py',
|
||||||
'zerver/lib/request.py',
|
|
||||||
'zerver/lib/upload.py',
|
'zerver/lib/upload.py',
|
||||||
'zerver/lib/validator.py',
|
'zerver/lib/validator.py',
|
||||||
'zerver/models.py',
|
'zerver/models.py',
|
||||||
|
|||||||
@@ -137,6 +137,15 @@ class DecoratorTestCase(TestCase):
|
|||||||
result = get_total(request)
|
result = get_total(request)
|
||||||
self.assertEqual(result, 21)
|
self.assertEqual(result, 21)
|
||||||
|
|
||||||
|
def test_REQ_converter_and_validator_invalid(self):
|
||||||
|
# type: () -> None
|
||||||
|
with self.assertRaisesRegex(Exception, "converter and validator are mutually exclusive"):
|
||||||
|
@has_request_variables
|
||||||
|
def get_total(request, numbers=REQ(validator=check_list(check_int),
|
||||||
|
converter=lambda: None)):
|
||||||
|
# type: (HttpRequest, Iterable[int]) -> int
|
||||||
|
return sum(numbers) # nocoverage -- isn't intended to be run
|
||||||
|
|
||||||
def test_REQ_validator(self):
|
def test_REQ_validator(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user