示例#1
0
def test_delete():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.put("file1", "abc")
    FS.delete("file1")
    with pytest.raises(exceptions.ProviderOperationFailure):
        FS.get("file1")
示例#2
0
def test_exception_has_provider():
    try:
        FS = LocalFilesystemProvider(cm)
        FS.connect("tmp")
        FS.wipe()
        FS.get("file1")
        assert False
    except exceptions.ProviderOperationFailure as e:
        assert e.provider == FS
示例#3
0
def test_multiple_sessions():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.wipe()
    FS.put("file1", "abc")
    providers, _ = LocalFilesystemProvider.load_cached_providers(cm)
    FS = providers[0]
    assert FS.get("file1") == "abc"
示例#4
0
def test_get_nonexisting():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.wipe()
    with pytest.raises(exceptions.ProviderOperationFailure):
        FS.get("file1")
示例#5
0
def test_roundtrip():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.put("file1", "abc")
    assert FS.get("file1") == "abc"