MCPcopy
hub / github.com/encode/starlette / test_url_query_params

Function test_url_query_params

tests/test_datastructures.py:72–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70
71
72def test_url_query_params() -> None:
73 u = URL("https://example.org/path/?page=3")
74 assert u.query == "page=3"
75 u = u.include_query_params(page=4)
76 assert str(u) == "https://example.org/path/?page=4"
77 u = u.include_query_params(search="testing")
78 assert str(u) == "https://example.org/path/?page=4&search=testing"
79 u = u.replace_query_params(order="name")
80 assert str(u) == "https://example.org/path/?order=name"
81 u = u.remove_query_params("order")
82 assert str(u) == "https://example.org/path/"
83 u = u.include_query_params(page=4, search="testing")
84 assert str(u) == "https://example.org/path/?page=4&search=testing"
85 u = u.remove_query_params(["page", "search"])
86 assert str(u) == "https://example.org/path/"
87
88
89def test_hidden_password() -> None:

Callers

nothing calls this directly

Calls 4

include_query_paramsMethod · 0.95
replace_query_paramsMethod · 0.95
remove_query_paramsMethod · 0.95
URLClass · 0.90

Tested by

no test coverage detected