Adds extra tests for CaseInsensitiveDict

- Test for NotImplemented in __eq__
- Adds test for copy()
- Adds test for __repr__()
This commit is contained in:
Gert Van Gool
2015-07-13 14:21:12 +02:00
parent 2440b6f089
commit 147a305da8
+15
View File
@@ -1224,6 +1224,7 @@ class TestCaseInsensitiveDict(unittest.TestCase):
del othercid['spam']
assert cid != othercid
assert cid == {'spam': 'blueval', 'eggs': 'redval'}
assert cid.__eq__(object()) == NotImplemented
def test_setdefault(self):
cid = CaseInsensitiveDict({'Spam': 'blueval'})
@@ -1261,6 +1262,20 @@ 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',
})
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):