def test_cant_add_trailing_slash_to_none_path(): path = Path(None) path = path.with_trailing_slash() assert path.string is None
def test_can_add_trailing_slash_to_empty_path(): path = Path("") path = path.with_trailing_slash() assert path.string == "/"
def test_wont_add_trailing_slash_to_path_that_already_has_one(): path = Path("/foo/bar/") path = path.with_trailing_slash() assert path.string == "/foo/bar/"
def test_wont_add_trailing_slash_to_root_path(): path = Path("/") path = path.with_trailing_slash() assert path.string == "/"
def test_can_add_trailing_slash_to_path(): path = Path("/foo/bar") path = path.with_trailing_slash() assert path.string == "/foo/bar/"