()
| 4 | |
| 5 | |
| 6 | def test_wrapper_internals(): |
| 7 | req = Request.from_values(data={"foo": "bar"}, method="POST") |
| 8 | req._load_form_data() |
| 9 | assert req.form.to_dict() == {"foo": "bar"} |
| 10 | |
| 11 | # second call does not break |
| 12 | req._load_form_data() |
| 13 | assert req.form.to_dict() == {"foo": "bar"} |
| 14 | |
| 15 | # check reprs |
| 16 | assert repr(req) == "<Request 'http://localhost/' [POST]>" |
| 17 | resp = Response() |
| 18 | assert repr(resp) == "<Response 0 bytes [200 OK]>" |
| 19 | resp.set_data("Hello World!") |
| 20 | assert repr(resp) == "<Response 12 bytes [200 OK]>" |
| 21 | resp.response = iter(["Test"]) |
| 22 | assert repr(resp) == "<Response streamed [200 OK]>" |
| 23 | |
| 24 | response = Response(["Hällo Wörld"]) |
| 25 | headers = response.get_wsgi_headers(create_environ()) |
| 26 | assert "Content-Length" in headers |
| 27 | |
| 28 | response = Response(["Hällo Wörld".encode()]) |
| 29 | headers = response.get_wsgi_headers(create_environ()) |
| 30 | assert "Content-Length" in headers |
nothing calls this directly
no test coverage detected