How to use the rfc3986.uri.URIReference.from_string function in rfc3986

To help you get started, we’ve selected a few rfc3986 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_uri_with_everything_requiring_fragment(
        self, uri_with_everything
    ):
        uri = URIReference.from_string(uri_with_everything)
        assert uri.is_valid(require_fragment=True) is True
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_uri_with_everything(self, uri_with_everything):
        uri = URIReference.from_string(uri_with_everything)
        assert uri == self.to_tuple(uri_with_everything)
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_basic_uris_with_paths_are_absolute(self, basic_uri_with_path):
        uri = URIReference.from_string(basic_uri_with_path)
        assert uri.is_absolute() is True
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_uri_with_everything_raises_exception(self, uri_with_everything):
        R = URIReference.from_string("foo/bar/bogus")
        B = URIReference.from_string(uri_with_everything)
        with pytest.raises(ResolutionError):
            R.resolve_with(B)
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_with_basic_uri_and_relative_path(self, basic_uri):
        R = URIReference.from_string("foo/bar/bogus")
        B = URIReference.from_string(basic_uri).normalize()
        T = R.resolve_with(B)
        assert T.scheme == B.scheme
        assert T.host == B.host
        assert T.path == "/" + R.path
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_absolute_path_uri(self, absolute_path_uri):
        uri = URIReference.from_string(absolute_path_uri)
        assert uri == self.to_tuple(absolute_path_uri)
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_with_basic_and_absolute_path_uris(
        self, basic_uri, absolute_path_uri
    ):
        R = URIReference.from_string(absolute_path_uri)
        B = URIReference.from_string(basic_uri).normalize()
        T = R.resolve_with(B)
        assert T.scheme == B.scheme
        assert T.host == B.host
        assert T.path == R.path
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_basic_uri(self, basic_uri):
        uri = URIReference.from_string(basic_uri)
        assert uri == self.to_tuple(basic_uri)
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_uri_with_everything_raises_exception(self, uri_with_everything):
        R = URIReference.from_string("foo/bar/bogus")
        B = URIReference.from_string(uri_with_everything)
        with pytest.raises(ResolutionError):
            R.resolve_with(B)