mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Adds extra tests for CaseInsensitiveDict
- Test for NotImplemented in __eq__ - Adds test for copy() - Adds test for __repr__()
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user