def test_with_argument_not_valid_annotation(): def method(argument: int): # pragma: no cover return argument annotation_decorator = request_body('argument') with pytest.raises(AssertionError) as exception: annotation_decorator(method) assert exception.value.args == ('Invalid request body type', )
def test_without_argument(): def method(argument: int): # pragma: no cover return argument annotation_decorator = request_body('invalid_argument') with pytest.raises(AssertionError) as exception: annotation_decorator(method) assert exception.value.args == ( 'Not found argument "invalid_argument" in "method"', )