Skip to content
Myr

Add Session.prepare_request test case.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Robert Estelle · committed by Robert Estelle · parent d4385f6 · Browse files · 1 file+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−0 removed

  • other:+17 added−0 removed

1 file+17 added−0 removed

modified:test_requests.py+17 added
487 unmodified lines
488489 a.params['_'] = '?'490 self.assertNotEqual(a.params, b.params)491492 def test_prepared_from_session(self):493 class DummyAuth(requests.auth.AuthBase):494 def __call__(self, r):495 r.headers['Dummy-Auth-Test'] = 'dummy-auth-test-ok'496 return r497498 req = requests.Request('GET', httpbin('headers'))499 self.assertEqual(req.auth, None)500501 s = requests.Session()502 s.auth = DummyAuth()503504 prep = s.prepare_request(req)505 resp = s.send(prep)506507 self.assertTrue(resp.json()['headers']['Dummy-Auth-Test'], 'dummy-auth-test-ok')508509 def test_links(self):510 r = requests.Response()511 r.headers = {512 'cache-control': 'public, max-age=60, s-maxage=60',
325 unmodified lines