Beispiel #1
0
def test_cannot_remove_trailing_slash_from_none_path():
    path = Path(None)
    path = path.without_trailing_slash()
    assert path.string is None
Beispiel #2
0
def test_cannot_remove_trailing_slash_from_empty_string():
    path = Path("")
    path = path.without_trailing_slash()
    assert path.string == ""
Beispiel #3
0
def test_wont_remove_trailing_slash_if_none_exists():
    path = Path("/foo/bar")
    path = path.without_trailing_slash()
    assert path.string == "/foo/bar"
Beispiel #4
0
def test_will_remove_root_path_slash():
    path = Path("/")
    path = path.without_trailing_slash()
    assert path.string == ""
Beispiel #5
0
def test_can_remove_trailing_slash_from_path():
    path = Path("/foo/bar/")
    path = path.without_trailing_slash()
    assert path.string == "/foo/bar"