def test_init_paths(tmppath): """Tests how __init__ responds to correct and invalid paths.""" # Invalid url should raise error url = "fee-fyyy-/fooo" assert not is_valid_url(url) \ and pytest.raises(PathError, XRootDFile, url) path = '//ARGMEGXXX//\\///' assert not is_valid_path(path) \ and pytest.raises(InvalidPathError, XRootDFile, mkurl(path))
def test_is_valid_path(): """Test is valid path.""" assert is_valid_path("//") assert is_valid_path("//something/wicked/this/tub/comes/") assert is_valid_path("//every/time") assert not is_valid_path("") assert not is_valid_path("/") assert not is_valid_path("///") assert not is_valid_path("//missing//what")