Rename RequestParameters to MultiParams, refs #799

This commit is contained in:
Simon Willison 2020-06-05 10:52:50 -07:00
commit 0da7f49b24
5 changed files with 36 additions and 16 deletions

View file

@ -437,3 +437,12 @@ def test_call_with_supported_arguments():
with pytest.raises(TypeError):
utils.call_with_supported_arguments(foo, a=1)
def test_multi_params_list():
p1 = utils.MultiParams([["foo", "bar"], ["foo", "baz"]])
assert "bar" == p1["foo"]
assert ["bar", "baz"] == p1.getlist("foo")
# Should raise an error if list isn't pairs
with pytest.raises(AssertionError):
utils.MultiParams([["foo", "bar"], ["foo", "baz", "bar"]])