Skip to content
Myr

Adds extra tests for CaseInsensitiveDict

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

- Test for NotImplemented in __eq__ - Adds test for copy() - Adds test for __repr__()

authored by Gert Van Gool · committed by Gert Van Gool · parent 2440b6f · Browse files · 1 file+15 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+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:test_requests.py+15 added
1222 unmodified lines
1223 assert cid == othercid1224 del othercid['spam']1225 assert cid != othercid1226 assert cid == {'spam': 'blueval', 'eggs': 'redval'}1227 assert cid.__eq__(object()) == NotImplemented12281229 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 assert cid == cid.copy()12711272 def test_repr(self):1273 cid = CaseInsensitiveDict({1274 'Accept': 'application/json',1275 'user-Agent': 'requests',1276 })1277 assert repr(cid) == "{'Accept': 'application/json', 'user-Agent': 'requests'}"127812791280class UtilsTestCase(unittest.TestCase):12811282 def test_super_len_io_streams(self):1283 """ Ensures that we properly deal with different kinds of IO streams. """
380 unmodified lines