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 sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
11 from appengine_blobstore import AppEngineBlobstore | 11 from appengine_blobstore import AppEngineBlobstore |
12 from appengine_url_fetcher import AppEngineUrlFetcher | 12 from appengine_url_fetcher import AppEngineUrlFetcher |
13 from appengine_wrappers import files | 13 from appengine_wrappers import files |
14 from fake_fetchers import ConfigureFakeFetchers | 14 from fake_fetchers import ConfigureFakeFetchers |
15 from github_file_system import GithubFileSystem | 15 from github_file_system import GithubFileSystem |
16 from in_memory_object_store import InMemoryObjectStore | |
17 import url_constants | 16 import url_constants |
18 | 17 |
19 class GithubFileSystemTest(unittest.TestCase): | 18 class GithubFileSystemTest(unittest.TestCase): |
20 def setUp(self): | 19 def setUp(self): |
21 ConfigureFakeFetchers(os.path.join(sys.path[0], os.pardir)) | 20 ConfigureFakeFetchers(os.path.join(sys.path[0], os.pardir)) |
22 self._base_path = os.path.join(sys.path[0], | 21 self._base_path = os.path.join(sys.path[0], |
23 'test_data', | 22 'test_data', |
24 'github_file_system') | 23 'github_file_system') |
25 self._file_system = GithubFileSystem( | 24 self._file_system = GithubFileSystem( |
26 AppEngineUrlFetcher(url_constants.GITHUB_URL), | 25 AppEngineUrlFetcher(url_constants.GITHUB_URL), |
(...skipping 16 matching lines...) Expand all Loading... |
43 | 42 |
44 def testKeyGeneration(self): | 43 def testKeyGeneration(self): |
45 self.assertEqual(0, len(files.GetBlobKeys())) | 44 self.assertEqual(0, len(files.GetBlobKeys())) |
46 self._file_system.ReadSingle('/analytics/launch.js') | 45 self._file_system.ReadSingle('/analytics/launch.js') |
47 self.assertEqual(1, len(files.GetBlobKeys())) | 46 self.assertEqual(1, len(files.GetBlobKeys())) |
48 self._file_system.ReadSingle('/analytics/main.css') | 47 self._file_system.ReadSingle('/analytics/main.css') |
49 self.assertEqual(1, len(files.GetBlobKeys())) | 48 self.assertEqual(1, len(files.GetBlobKeys())) |
50 | 49 |
51 if __name__ == '__main__': | 50 if __name__ == '__main__': |
52 unittest.main() | 51 unittest.main() |
OLD | NEW |