coverage: bring zerver/lib/request.py to 100% coverage.

This commit is contained in:
Tim Abbott 2017-03-05 00:12:46 -08:00
parent e7ff3415ab
commit 89decf6ded
2 changed files with 9 additions and 1 deletions

View File

@ -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',

View File

@ -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