mirror of https://github.com/zulip/zulip.git
coverage: bring zerver/lib/request.py to 100% coverage.
This commit is contained in:
parent
e7ff3415ab
commit
89decf6ded
|
@ -77,7 +77,6 @@ not_yet_fully_covered = {
|
|||
'zerver/lib/message.py',
|
||||
'zerver/lib/notifications.py',
|
||||
'zerver/lib/push_notifications.py',
|
||||
'zerver/lib/request.py',
|
||||
'zerver/lib/upload.py',
|
||||
'zerver/lib/validator.py',
|
||||
'zerver/models.py',
|
||||
|
|
|
@ -137,6 +137,15 @@ class DecoratorTestCase(TestCase):
|
|||
result = get_total(request)
|
||||
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):
|
||||
# type: () -> None
|
||||
|
||||
|
|
Loading…
Reference in New Issue