MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_array_brackets

Function test_array_brackets

tests/test_qs.py:65–73  ·  view source on GitHub ↗
(method: str)

Source from the content-addressed store, hash-verified

63
64@pytest.mark.parametrize("method", ["class", "function"])
65def test_array_brackets(method: str) -> None:
66 if method == "class":
67 serialise = Querystring(array_format="brackets").stringify
68 else:
69 serialise = partial(stringify, array_format="brackets")
70
71 assert unquote(serialise({"in": ["foo", "bar"]})) == "in[]=foo&in[]=bar"
72 assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b][]=true&a[b][]=false"
73 assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b][]=true&a[b][]=false&a[b][]=true"
74
75
76def test_unknown_array_format() -> None:

Callers

nothing calls this directly

Calls 1

QuerystringClass · 0.90

Tested by

no test coverage detected