Skip to content
Myr

testing session method attribute merging

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 65a765f · Browse files · 1 file+7 added−2 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+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:test_requests.py+7 added-2 removed
451 unmodified lines
452 heads = {'User-agent': 'Mozilla/5.0'}453454 s = Session()455 s.headers = heads456457 # Make 2 requests from Session object, should send header both times458 r1 = s.get(httpbin('user-agent'))458459 assert heads['User-agent'] in r1.content460 r2 = s.get(httpbin('user-agent'))460461 r2 = s.get(httpbin('user-agent'))462 assert heads['User-agent'] in r2.content463464 new_heads = {'User-agent': 'blah'}465 r3 = s.get(httpbin('user-agent'), headers=new_heads)466 assert new_heads['User-agent'] in r3.content467468 self.assertEqual(r2.status_code, 200)469470471if __name__ == '__main__':
1 unmodified line