How to use the rfc3986.misc.merge_paths 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_misc.py View on Github external
def test_merge_paths_with_base_authority_and_path():
    """Demonstrate merging with a base URI with an authority and path."""
    base = URIReference(
        scheme=None,
        authority="authority",
        path="/foo/bar/bogus",
        query=None,
        fragment=None,
    )
    expected = "/foo/bar/relative"
    assert merge_paths(base, "relative") == expected
github python-hyper / rfc3986 / tests / test_misc.py View on Github external
def test_merge_paths_without_base_authority_or_path():
    """Demonstrate merging with a base URI without an authority or path."""
    base = URIReference(
        scheme=None, authority=None, path=None, query=None, fragment=None
    )
    expected = "/relative"
    assert merge_paths(base, "relative") == expected
github python-hyper / rfc3986 / tests / test_misc.py View on Github external
def test_merge_paths_with_base_path_without_base_authority():
    """Demonstrate merging with a base URI without an authority."""
    base = URIReference(
        scheme=None,
        authority=None,
        path="/foo/bar/bogus",
        query=None,
        fragment=None,
    )
    expected = "/foo/bar/relative"
    assert merge_paths(base, "relative") == expected
github python-hyper / rfc3986 / tests / test_misc.py View on Github external
def test_merge_paths_with_base_authority_without_path():
    """Demonstrate merging with a base URI without an authority or path."""
    base = URIReference(
        scheme=None,
        authority="authority",
        path=None,
        query=None,
        fragment=None,
    )
    expected = "/relative"
    assert merge_paths(base, "relative") == expected