コード例 #1
0
def test_setcontents(tmppath):
    """Test setcontents."""
    fs = XRootDPyFS(mkurl(tmppath))
    fs.setcontents('data/testa.txt', "mytest")
    assert fs.getcontents('data/testa.txt') == "mytest"
コード例 #2
0
def test_setcontents(tmppath):
    """Test setcontents."""
    fs = XRootDPyFS(mkurl(tmppath))
    fs.setcontents('data/testa.txt', "mytest")
    assert fs.getcontents('data/testa.txt') == b"mytest"
コード例 #3
0
def test_getcontents(tmppath):
    """Test getcontents."""
    fs = XRootDPyFS(mkurl(tmppath))
    assert fs.getcontents('data/testa.txt') == "testa.txt\n"
    pytest.raises(ResourceNotFoundError, fs.getcontents, 'data/invalid.txt')
コード例 #4
0
def test_getcontents(tmppath):
    """Test getcontents."""
    fs = XRootDPyFS(mkurl(tmppath))
    assert fs.getcontents('data/testa.txt') == b"testa.txt\n"
    pytest.raises(ResourceNotFoundError, fs.getcontents, 'data/invalid.txt')