예제 #1
0
 def test_case_insensitive_dict_key_value_update(self):
     d = CaseInsensitiveDict({"X-key": "X-value"})
     d["x-key"] = "x-value"
     self.assertEqual(1, len(d))
     self.assertEqual("x-key", list(d.keys())[0])
     self.assertEqual("x-value", list(d.values())[0])
     self.assertEqual("x-value", d["x-key"])
예제 #2
0
 def headers(self, value):
     self._headers = CaseInsensitiveDict(value) or CaseInsensitiveDict()
예제 #3
0
 def case_insensitive_dict(self):
     return CaseInsensitiveDict(self.json)
예제 #4
0
 def test_case_insensitive_dict_key_value_name_duplicated_keys(self):
     d = CaseInsensitiveDict({"X-key": "X-value", "x-key": "x-value"})
     self.assertEqual(1, len(d))
     self.assertEqual("X-key".lower(), list(d.keys())[0].lower())
예제 #5
0
 def __init__(self, json_data):
     self.json = json_data
     self.case_insensitive_dict = CaseInsensitiveDict(self.json)