| 72 | |
| 73 | class TestRequestData: |
| 74 | def test_init(self): |
| 75 | with pytest.raises(UnicodeEncodeError): |
| 76 | treq(method="fööbär") |
| 77 | with pytest.raises(UnicodeEncodeError): |
| 78 | treq(scheme="fööbär") |
| 79 | assert treq(host="fööbär").host == "fööbär" |
| 80 | with pytest.raises(UnicodeEncodeError): |
| 81 | treq(path="/fööbär") |
| 82 | with pytest.raises(UnicodeEncodeError): |
| 83 | treq(http_version="föö/bä.r") |
| 84 | with pytest.raises(ValueError): |
| 85 | treq(headers="foobar") |
| 86 | with pytest.raises(ValueError): |
| 87 | treq(content="foobar") |
| 88 | with pytest.raises(ValueError): |
| 89 | treq(trailers="foobar") |
| 90 | |
| 91 | assert isinstance(treq(headers=()).headers, Headers) |
| 92 | assert isinstance(treq(trailers=()).trailers, Headers) |
| 93 | |
| 94 | |
| 95 | class TestRequestCore: |