Skip to content
Myr

Adding test to ensure options like stream function with authentication

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

This test demonstrates the reason why we need to pass kwargs to hooks. Without it, features like stream cannot work with authentication.

authored by Michael Komitee · committed by Michael Komitee · parent d0285fa · Browse files · 1 file+12 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+12 added−0 removed

  • other:+12 added−0 removed

1 file+12 added−0 removed

modified:test_requests.py+12 added
170 unmodified lines
171 s.auth = auth172 r = s.get(url)173 self.assertEqual(r.status_code, 200)174175 def test_DIGEST_STREAM(self):176177 auth = HTTPDigestAuth('user', 'pass')178 url = httpbin('digest-auth', 'auth', 'user', 'pass')179180 r = requests.get(url, auth=auth, stream=True)181 self.assertNotEqual(r.raw.read(), '')182183 r = requests.get(url, auth=auth, stream=False)184 self.assertEqual(r.raw.read(), '')185186187 def test_DIGESTAUTH_WRONG_HTTP_401_GET(self):188189 auth = HTTPDigestAuth('user', 'wrongpass')190 url = httpbin('digest-auth', 'auth', 'user', 'pass')
180 unmodified lines