def test_move(azure): with azure_teardown(azure): azure.touch(a) assert azure.exists(a, invalidate_cache=False) assert not azure.exists(b, invalidate_cache=False) azure.mv(a, b) assert not azure.exists(a, invalidate_cache=False) assert azure.exists(b, invalidate_cache=False)
def test_move(azure): with azure_teardown(azure): azure.touch(a) assert azure.exists(a) assert not azure.exists(b) azure.mv(a, b) assert not azure.exists(a) assert azure.exists(b)
def test_errors(azure): with pytest.raises((IOError, OSError)): azure.open(test_dir / 'shfoshf', 'rb') # This is totally OK: directory is silently created # Will need extend invalidate_cache # with pytest.raises((IOError, OSError)): # azure.touch(test_dir / 'shfoshf' / 'x') with pytest.raises((IOError, OSError)): azure.rm(test_dir / 'shfoshf' / 'xxx') with pytest.raises((IOError, OSError)): azure.mv(test_dir / 'shfoshf' / 'x', test_dir / 'shfoshxbf' / 'y') # with pytest.raises(IOError): # azure.chown('unknown', 'someone', 'group') # with pytest.raises(IOError): # azure.chmod('unknonwn', 'rb') with pytest.raises(IOError): azure.rm(test_dir / 'unknown')