Ejemplo n.º 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")
Ejemplo n.º 2
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"
Ejemplo n.º 3
0
def test_wipe():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.put("file1", "abc")
    FS.put("file2", "def")
    FS.wipe()

    assert len(os.listdir("tmp/" + FS.ROOT_DIR)) == 0
Ejemplo n.º 4
0
def test_roundtrip():
    FS = LocalFilesystemProvider(cm)
    FS.connect("tmp")
    FS.put("file1", "abc")
    assert FS.get("file1") == "abc"