def test_safe_set_no_perms(self, tmpdir): cache_dir = tmpdir.join("unreadable-cache") cache_dir.makedirs() os.chmod(cache_dir, 000) cache = SafeFileCache(cache_dir) cache.set("foo", b"bar")
def test_safe_set_no_perms(self, tmpdir): cache_dir = tmpdir.join("unreadable-cache") cache_dir.makedirs() os.chmod(cache_dir, 000) cache = SafeFileCache(cache_dir) cache.set("foo", b"bar")
def test_cache_roundtrip(self, cache_tmpdir): cache = SafeFileCache(cache_tmpdir) assert cache.get("test key") is None cache.set("test key", b"a test string") assert cache.get("test key") == b"a test string" cache.delete("test key") assert cache.get("test key") is None
def test_cache_roundtrip(self, cache_tmpdir): cache = SafeFileCache(cache_tmpdir) assert cache.get("test key") is None cache.set("test key", b"a test string") assert cache.get("test key") == b"a test string" cache.delete("test key") assert cache.get("test key") is None
def test_cache_roundtrip(self, tmpdir): cache_dir = tmpdir.join("test-cache") cache_dir.makedirs() cache = SafeFileCache(cache_dir) assert cache.get("test key") is None cache.set("test key", b"a test string") assert cache.get("test key") == b"a test string" cache.delete("test key") assert cache.get("test key") is None
def test_cache_roundtrip(self, tmpdir): cache_dir = tmpdir.join("test-cache") cache_dir.makedirs() cache = SafeFileCache(cache_dir) assert cache.get("test key") is None cache.set("test key", b"a test string") assert cache.get("test key") == b"a test string" cache.delete("test key") assert cache.get("test key") is None
def test_safe_set_no_perms(self, cache_tmpdir): os.chmod(cache_tmpdir, 000) cache = SafeFileCache(cache_tmpdir) cache.set("foo", b"bar")
def test_safe_set_no_perms(self, cache_tmpdir): os.chmod(cache_tmpdir, 000) cache = SafeFileCache(cache_tmpdir) cache.set("foo", b"bar")