MCPcopy
hub / github.com/pallets/werkzeug / test_reject_newlines

Method test_reject_newlines

tests/test_datastructures.py:738–751  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

736 assert a["Content-Disposition"] == "attachment; filename=foo"
737
738 def test_reject_newlines(self):
739 h = self.storage_class()
740
741 for variation in "foo\nbar", "foo\r\nbar", "foo\rbar":
742 with pytest.raises(ValueError):
743 h["foo"] = variation
744 with pytest.raises(ValueError):
745 h.add("foo", variation)
746 with pytest.raises(ValueError):
747 h.add("foo", "test", option=variation)
748 with pytest.raises(ValueError):
749 h.set("foo", variation)
750 with pytest.raises(ValueError):
751 h.set("foo", "test", option=variation)
752
753 def test_slicing(self):
754 # there's nothing wrong with these being native strings

Callers

nothing calls this directly

Calls 2

addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected