コード例 #1
0
 def test_preserve_key_case(self):
     cid = CaseInsensitiveDict(
         {
             "Accept": "application/json",
             "user-Agent": "requests",
         }
     )
     keyset = frozenset(["Accept", "user-Agent"])
     assert frozenset(i[0] for i in cid.items()) == keyset
     assert frozenset(cid.keys()) == keyset
     assert frozenset(cid) == keyset
コード例 #2
0
 def test_preserve_last_key_case(self):
     cid = CaseInsensitiveDict(
         {
             "Accept": "application/json",
             "user-Agent": "requests",
         }
     )
     cid.update({"ACCEPT": "application/json"})
     cid["USER-AGENT"] = "requests"
     keyset = frozenset(["ACCEPT", "USER-AGENT"])
     assert frozenset(i[0] for i in cid.items()) == keyset
     assert frozenset(cid.keys()) == keyset
     assert frozenset(cid) == keyset