Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: client/tests/named_cache_test.py

Issue 2752293002: named_caches: make more resilient to corrupted state (Closed)
Patch Set: lint Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/named_cache.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/named_cache_test.py
diff --git a/client/tests/named_cache_test.py b/client/tests/named_cache_test.py
index 374a5f637f753c0c403a3e00cbacc2e8efa24eda..e1330f0d604cd32202aed8448a0b8c885016fc7e 100755
--- a/client/tests/named_cache_test.py
+++ b/client/tests/named_cache_test.py
@@ -16,6 +16,7 @@ sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party'))
from depot_tools import fix_encoding
from utils import file_path
+from utils import fs
import named_cache
@@ -92,6 +93,15 @@ class CacheManagerTest(unittest.TestCase):
set(os.listdir(os.path.join(self.tempdir, 'named'))),
)
+ def test_corrupted(self):
+ with open(os.path.join(self.tempdir, u'state.json'), 'w') as f:
+ f.write('}}}}')
+ fs.makedirs(os.path.join(self.tempdir, 'a'), 0777)
+ with self.manager.open():
+ self.assertFalse(os.path.isdir(self.tempdir))
+ self.manager.request('a')
+ self.assertTrue(fs.islink(os.path.join(self.tempdir, 'named', 'a')))
+
if __name__ == '__main__':
fix_encoding.fix_encoding()
« no previous file with comments | « client/named_cache.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698