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