コード例 #1
0
    def test_query_valid(self):
        param = Parameter('param', 'query')
        value = 'test'

        result = param.cast(value)

        assert result == value
コード例 #2
0
    def test_deprecated(self):
        param = Parameter('param', 'query', deprecated=True)
        value = 'test'

        with pytest.warns(DeprecationWarning):
            result = param.cast(value)

        assert result == value
コード例 #3
0
    def test_query_empty(self):
        param = Parameter('param', 'query')
        value = ''

        with pytest.raises(EmptyParameterValue):
            param.cast(value)