Exemplo n.º 1
0
 def test_to_str_error(self):
     with pytest.raises(TypeError, match="not expecting type int"):
         to_str(1)
Exemplo n.º 2
0
 def test_to_str(self, input, params, expected):
     assert to_str(input, **params) == expected
Exemplo n.º 3
0
 def echo_params(self, request):
     params = sorted([(to_str(k), to_str(v)) for k, v in request.params.items()])
     return Response(repr(params))
Exemplo n.º 4
0
 def echo_params(self, request: httputil.HTTPServerRequest) -> Response:
     params = request_params(request)
     echod = sorted((to_str(k), to_str(v)) for k, v in params.items())
     return Response(repr(echod))
Exemplo n.º 5
0
 def test_to_str(self, input: Union[bytes, str], params: Dict[str, str],
                 expected: str) -> None:
     assert to_str(input, **params) == expected
Exemplo n.º 6
0
 def test_to_str_error(self) -> None:
     with pytest.raises(TypeError, match="not expecting type int"):
         to_str(1)  # type: ignore[arg-type]