def test_to_str_error(self): with pytest.raises(TypeError, match="not expecting type int"): to_str(1)
def test_to_str(self, input, params, expected): assert to_str(input, **params) == expected
def echo_params(self, request): params = sorted([(to_str(k), to_str(v)) for k, v in request.params.items()]) return Response(repr(params))
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))
def test_to_str(self, input: Union[bytes, str], params: Dict[str, str], expected: str) -> None: assert to_str(input, **params) == expected
def test_to_str_error(self) -> None: with pytest.raises(TypeError, match="not expecting type int"): to_str(1) # type: ignore[arg-type]