| 761 | assert list(h) == [("X-Foo-Poo", "bleh"), ("X-Forwarded-For", "192.168.0.123")] |
| 762 | |
| 763 | def test_extend(self): |
| 764 | h = self.storage_class([("a", "0"), ("b", "1"), ("c", "2")]) |
| 765 | h.extend(ds.Headers([("a", "3"), ("a", "4")])) |
| 766 | assert h.getlist("a") == ["0", "3", "4"] |
| 767 | h.extend(b=["5", "6"]) |
| 768 | assert h.getlist("b") == ["1", "5", "6"] |
| 769 | h.extend({"c": "7", "d": ["8", "9"]}, c="10") |
| 770 | assert h.getlist("c") == ["2", "7", "10"] |
| 771 | assert h.getlist("d") == ["8", "9"] |
| 772 | |
| 773 | with pytest.raises(TypeError): |
| 774 | h.extend({"x": "x"}, {"x": "x"}) |
| 775 | |
| 776 | def test_update(self): |
| 777 | h = self.storage_class([("a", "0"), ("b", "1"), ("c", "2")]) |