| 34 | assert hash(r) |
| 35 | |
| 36 | def test_get_url(self): |
| 37 | r = treq() |
| 38 | |
| 39 | assert r.url == "http://address:22/path" |
| 40 | |
| 41 | r.scheme = "https" |
| 42 | assert r.url == "https://address:22/path" |
| 43 | |
| 44 | r.host = "host" |
| 45 | r.port = 42 |
| 46 | assert r.url == "https://host:42/path" |
| 47 | |
| 48 | r.host = "address" |
| 49 | r.port = 22 |
| 50 | assert r.url == "https://address:22/path" |
| 51 | |
| 52 | assert r.pretty_url == "https://address:22/path" |
| 53 | r.headers["Host"] = "foo.com:22" |
| 54 | assert r.url == "https://address:22/path" |
| 55 | assert r.pretty_url == "https://foo.com:22/path" |
| 56 | |
| 57 | def test_constrain_encoding(self): |
| 58 | r = treq() |