def test_int_value(self): h1 = Headers({'hey': 5}) h1['foo'] = 1 h1.setdefault('bar', 2) h1.setlist('buz', [1, 'dos', 3]) self.assertEqual(h1.getlist('foo'), [b'1']) self.assertEqual(h1.getlist('bar'), [b'2']) self.assertEqual(h1.getlist('buz'), [b'1', b'dos', b'3']) self.assertEqual(h1.getlist('hey'), [b'5'])
def test_int_value(self): h1 = Headers({"hey": 5}) h1["foo"] = 1 h1.setdefault("bar", 2) h1.setlist("buz", [1, "dos", 3]) self.assertEqual(h1.getlist("foo"), [b"1"]) self.assertEqual(h1.getlist("bar"), [b"2"]) self.assertEqual(h1.getlist("buz"), [b"1", b"dos", b"3"]) self.assertEqual(h1.getlist("hey"), [b"5"])
def test_setlist(self): h1 = Headers({'header1': 'value1'}) self.assertEqual(h1.getlist('header1'), ['value1']) h1.setlist('header1', ['value2', 'value3']) self.assertEqual(h1.getlist('header1'), ['value2', 'value3'])
def test_setlist(self): h1 = Headers({"header1": "value1"}) self.assertEqual(h1.getlist("header1"), [b"value1"]) h1.setlist("header1", [b"value2", b"value3"]) self.assertEqual(h1.getlist("header1"), [b"value2", b"value3"])