Skip to content
Myr

test session persistent params

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 8c74860 · Browse files · 1 file+28 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+28 added−0 removed

  • other:+28 added−0 removed

1 file+28 added−0 removed

modified:test_requests.py+28 added
466 unmodified lines
467468 self.assertEqual(r2.status_code, 200)469470471 def test_session_persistent_params(self):472473 params = {'a': 'a_test'}474475 s = Session()476 s.params = params477478 # Make 2 requests from Session object, should send header both times479 r1 = s.get(httpbin('get'))480 assert params['a'] in r1.content481482483 params2 = {'b': 'b_test'}484485 r2 = s.get(httpbin('get'), params=params2)486 assert params['a'] in r2.content487 assert params2['b'] in r2.content488489490 params3 = {'b': 'b_test', 'a': None, 'c': 'c_test'}491492 r3 = s.get(httpbin('get'), params=params3)493494 assert not params['a'] in r3.content495 assert params3['b'] in r3.content496 assert params3['c'] in r3.content497498499if __name__ == '__main__':500 unittest.main()