MCPcopy
hub / github.com/encode/httpx / test_url_copywith_userinfo_subcomponents

Function test_url_copywith_userinfo_subcomponents

tests/models/test_url.py:606–616  ·  tests/models/test_url.py::test_url_copywith_userinfo_subcomponents
()

Source from the content-addressed store, hash-verified

604
605
606def test_url_copywith_userinfo_subcomponents():
607 copy_with_kwargs = {
608 class="st">"username": class="st">"tom@example.org",
609 class="st">"password": class="st">"abc123@ %",
610 }
611 url = httpx.URL(class="st">"https://example.org")
612 new = url.copy_with(**copy_with_kwargs)
613 assert str(new) == class="st">"https://tom%40example.org:abc123%40%20%@example.org"
614 assert new.username == class="st">"tom@example.org"
615 assert new.password == class="st">"abc123@ %"
616 assert new.userinfo == bclass="st">"tom%40example.org:abc123%40%20%"
617
618
619def test_url_copywith_invalid_component():

Callers

nothing calls this directly

Calls 1

copy_withMethod · 0.95

Tested by

no test coverage detected