(self, httpbin)
| 1211 | assert hasattr(resp, "hook_working") |
| 1212 | |
| 1213 | def test_prepared_from_session(self, httpbin): |
| 1214 | class DummyAuth(requests.auth.AuthBase): |
| 1215 | def __call__(self, r): |
| 1216 | r.headers["Dummy-Auth-Test"] = "dummy-auth-test-ok" |
| 1217 | return r |
| 1218 | |
| 1219 | req = requests.Request("GET", httpbin("headers")) |
| 1220 | assert not req.auth |
| 1221 | |
| 1222 | s = requests.Session() |
| 1223 | s.auth = DummyAuth() |
| 1224 | |
| 1225 | prep = s.prepare_request(req) |
| 1226 | resp = s.send(prep) |
| 1227 | |
| 1228 | assert resp.json()["headers"]["Dummy-Auth-Test"] == "dummy-auth-test-ok" |
| 1229 | |
| 1230 | def test_prepare_request_with_bytestring_url(self): |
| 1231 | req = requests.Request("GET", b"https://httpbin.org/") |
nothing calls this directly
no test coverage detected