(py_and_json: PyAndJson)
| 11 | |
| 12 | |
| 13 | def test_url_ok(py_and_json: PyAndJson): |
| 14 | v = py_and_json(core_schema.url_schema()) |
| 15 | url = v.validate_test('https://example.com/foo/bar?baz=qux#quux') |
| 16 | |
| 17 | assert isinstance(url, Url) |
| 18 | assert str(url) == 'https://example.com/foo/bar?baz=qux#quux' |
| 19 | assert repr(url) == "Url('https://example.com/foo/bar?baz=qux#quux')" |
| 20 | assert url.unicode_string() == 'https://example.com/foo/bar?baz=qux#quux' |
| 21 | assert url.scheme == 'https' |
| 22 | assert url.host == 'example.com' |
| 23 | assert url.unicode_host() == 'example.com' |
| 24 | assert url.path == '/foo/bar' |
| 25 | assert url.query == 'baz=qux' |
| 26 | assert url.query_params() == [('baz', 'qux')] |
| 27 | assert url.fragment == 'quux' |
| 28 | assert url.username is None |
| 29 | assert url.password is None |
| 30 | assert url.port == 443 |
| 31 | |
| 32 | |
| 33 | def test_url_from_constructor_ok(): |
nothing calls this directly
no test coverage detected