| 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()
|
|
|