Skip to content
Myr

Merge pull request #2666 from gvangool/extra_tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Adds extra tests for CaseInsensitiveDict

authored by Cory Benfield · committed by Cory Benfield · parents 2440b6f, 3b325f1 · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • other:+18 added−0 removed

1 file+18 added−0 removed

modified:test_requests.py+18 added
1222 unmodified lines
1223 assert cid == othercid1224 del othercid['spam']1225 assert cid != othercid1226 assert cid == {'spam': 'blueval', 'eggs': 'redval'}1227 assert cid != object()12281229 def test_setdefault(self):1230 cid = CaseInsensitiveDict({'Spam': 'blueval'})1231 assert cid.setdefault('spam', 'notblueval') == 'blueval'
29 unmodified lines
1261 assert frozenset(i[0] for i in cid.items()) == keyset1262 assert frozenset(cid.keys()) == keyset1263 assert frozenset(cid) == keyset12641265 def test_copy(self):1266 cid = CaseInsensitiveDict({1267 'Accept': 'application/json',1268 'user-Agent': 'requests',1269 })1270 cid_copy = cid.copy()1271 assert cid == cid_copy1272 cid['changed'] = True1273 assert cid != cid_copy12741275 def test_repr(self):1276 cid = CaseInsensitiveDict({1277 'Accept': 'application/json',1278 'user-Agent': 'requests',1279 })1280 assert repr(cid) == "{'Accept': 'application/json', 'user-Agent': 'requests'}"128112821283class UtilsTestCase(unittest.TestCase):12841285 def test_super_len_io_streams(self):1286 """ Ensures that we properly deal with different kinds of IO streams. """
380 unmodified lines