mirror of
https://github.com/kennethreitz/requests3.git
synced 2026-06-05 23:10:16 +00:00
Merge pull request #2666 from gvangool/extra_tests
Adds extra tests for CaseInsensitiveDict
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 != 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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user