Merge pull request #2666 from gvangool/extra_tests

Adds extra tests for CaseInsensitiveDict
This commit is contained in:
Cory Benfield
2015-07-14 07:57:58 +01:00
+18
View File
@@ -1224,6 +1224,7 @@ class TestCaseInsensitiveDict(unittest.TestCase):
del othercid['spam']
assert cid != othercid
assert cid == {'spam': 'blueval', 'eggs': 'redval'}
assert cid != object()
def test_setdefault(self):
cid = CaseInsensitiveDict({'Spam': 'blueval'})
@@ -1261,6 +1262,23 @@ class TestCaseInsensitiveDict(unittest.TestCase):
assert frozenset(cid.keys()) == keyset
assert frozenset(cid) == keyset
def test_copy(self):
cid = CaseInsensitiveDict({
'Accept': 'application/json',
'user-Agent': 'requests',
})
cid_copy = cid.copy()
assert cid == cid_copy
cid['changed'] = True
assert cid != cid_copy
def test_repr(self):
cid = CaseInsensitiveDict({
'Accept': 'application/json',
'user-Agent': 'requests',
})
assert repr(cid) == "{'Accept': 'application/json', 'user-Agent': 'requests'}"
class UtilsTestCase(unittest.TestCase):