From: Colin Dunklau Date: Wed, 1 May 2013 17:48:21 +0000 (-0500) Subject: Minor update to tests, added docstrings X-Git-Tag: v1.2.1~2^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f93275c47f1557793bec348918013750e6902ff4;p=services%2Fpython-requests.git Minor update to tests, added docstrings Requested by @sigmavirus24. --- diff --git a/test_requests.py b/test_requests.py index 953ecca..da0adb1 100644 --- a/test_requests.py +++ b/test_requests.py @@ -460,7 +460,11 @@ class RequestsTestCase(unittest.TestCase): self.assertEqual(r.status_code, 200) def test_fixes_1329(self): + """ + Ensure that header updates are done case-insensitively. + """ s = requests.Session() + s.headers.update({'ACCEPT': 'BOGUS'}) s.headers.update({'accept': 'application/json'}) r = s.get(httpbin('get')) headers = r.request.headers @@ -473,6 +477,10 @@ class RequestsTestCase(unittest.TestCase): headers['Accept'.encode('ascii')], 'application/json' ) + self.assertEqual( + headers['ACCEPT'.encode('ascii')], + 'application/json' + ) class TestCaseInsensitiveDict(unittest.TestCase): @@ -512,6 +520,7 @@ class TestCaseInsensitiveDict(unittest.TestCase): self.assertEqual(cid['SPAM'], 'blueval') def test_fixes_649(self): + """__setitem__ should behave case-insensitively.""" cid = CaseInsensitiveDict() cid['spam'] = 'oneval' cid['Spam'] = 'twoval'