| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 from file_system_cache import FileSystemCache | 10 from file_system_cache import FileSystemCache |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 './', | 29 './', |
| 30 FakeSamplesDataSource()) | 30 FakeSamplesDataSource()) |
| 31 data_source = data_source_factory.Create({}) | 31 data_source = data_source_factory.Create({}) |
| 32 | 32 |
| 33 # Take the dict out of the list. | 33 # Take the dict out of the list. |
| 34 expected = json.loads(self._ReadLocalFile('expected_test_file.json')) | 34 expected = json.loads(self._ReadLocalFile('expected_test_file.json')) |
| 35 expected['permissions'] = None | 35 expected['permissions'] = None |
| 36 self.assertEqual(expected, data_source['test_file']) | 36 self.assertEqual(expected, data_source['test_file']) |
| 37 self.assertEqual(expected, data_source['testFile']) | 37 self.assertEqual(expected, data_source['testFile']) |
| 38 self.assertEqual(expected, data_source['testFile.html']) | 38 self.assertEqual(expected, data_source['testFile.html']) |
| 39 self.assertRaises(OSError, data_source.get, 'junk') | 39 self.assertRaises(IOError, data_source.get, 'junk') |
| 40 | 40 |
| 41 if __name__ == '__main__': | 41 if __name__ == '__main__': |
| 42 unittest.main() | 42 unittest.main() |
| OLD | NEW |