(method: str)
| 74 | |
| 75 | @pytest.mark.parametrize("method", ["class", "function"]) |
| 76 | def test_array_brackets(method: str) -> None: |
| 77 | if method == "class": |
| 78 | serialise = Querystring(array_format="brackets").stringify |
| 79 | else: |
| 80 | serialise = partial(stringify, array_format="brackets") |
| 81 | |
| 82 | assert unquote(serialise({"in": ["foo", "bar"]})) == "in[]=foo&in[]=bar" |
| 83 | assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b][]=true&a[b][]=false" |
| 84 | assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b][]=true&a[b][]=false&a[b][]=true" |
| 85 | assert unquote(serialise({"in": ["", "foo"]})) == "in[]=&in[]=foo" |
| 86 | |
| 87 | |
| 88 | def test_unknown_array_format() -> None: |
nothing calls this directly
no test coverage detected