def test_cannot_remove_trailing_slash_from_none_path(): path = Path(None) path = path.without_trailing_slash() assert path.string is None
def test_cannot_remove_trailing_slash_from_empty_string(): path = Path("") path = path.without_trailing_slash() assert path.string == ""
def test_wont_remove_trailing_slash_if_none_exists(): path = Path("/foo/bar") path = path.without_trailing_slash() assert path.string == "/foo/bar"
def test_will_remove_root_path_slash(): path = Path("/") path = path.without_trailing_slash() assert path.string == ""
def test_can_remove_trailing_slash_from_path(): path = Path("/foo/bar/") path = path.without_trailing_slash() assert path.string == "/foo/bar"