예제 #1
0
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, XRootDPyFile, url)

    path = "//ARGMEGXXX//\\///"
    assert not is_valid_path(path) and pytest.raises(InvalidPathError, XRootDPyFile, mkurl(path))
예제 #2
0
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, XRootDPyFile, url)

    path = '//ARGMEGXXX//\\///'
    assert not is_valid_path(path) \
        and pytest.raises(InvalidPathError, XRootDPyFile, mkurl(path))
예제 #3
0
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")
예제 #4
0
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")