Example #1
0
def test__urlify__valid() -> None:

    path = f"{os.sep}path{os.sep}to{os.sep}asset"

    url = Utils.urlify(path=path, leading_slash=False)
    url_slash = Utils.urlify(path=path)

    assert url == f"path{os.sep}to{os.sep}asset"
    assert url_slash == f"{os.sep}path{os.sep}to{os.sep}asset"
Example #2
0
def test__urlify__valid_slugify() -> None:

    path = f"{os.sep}path with spaces and s#ymbo$ls{os.sep}to{os.sep}asset"

    url_slugified = Utils.urlify(path=path, slugify=True)

    assert (url_slugified ==
            f"{os.sep}path-with-spaces-and-symbols{os.sep}to{os.sep}asset")