Skip to content
Myr

Merge pull request #1341 from cdunklau/docstring_test_1329

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

Minor update to tests, added docstrings

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 4f83ef8, f93275c · Browse files · 1 file+9 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+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:test_requests.py+9 added
458 unmodified lines
459 r = s.send(r.prepare())460 self.assertEqual(r.status_code, 200)461462 def test_fixes_1329(self):463 """464 Ensure that header updates are done case-insensitively.465 """466 s = requests.Session()467 s.headers.update({'ACCEPT': 'BOGUS'})468 s.headers.update({'accept': 'application/json'})469 r = s.get(httpbin('get'))470 headers = r.request.headers471 # ASCII encode because of key comparison changes in py3
4 unmodified lines
476 self.assertEqual(477 headers['Accept'.encode('ascii')],478 'application/json'479 )480 self.assertEqual(481 headers['ACCEPT'.encode('ascii')],482 'application/json'483 )484485486class TestCaseInsensitiveDict(unittest.TestCase):487
31 unmodified lines
519 self.assertEqual(cid['spam'], 'blueval')520 self.assertEqual(cid['SPAM'], 'blueval')521522 def test_fixes_649(self):523 """__setitem__ should behave case-insensitively."""524 cid = CaseInsensitiveDict()525 cid['spam'] = 'oneval'526 cid['Spam'] = 'twoval'527 cid['sPAM'] = 'redval'
105 unmodified lines