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

Side by Side Diff: chrome/common/extensions/docs/server2/github_file_system_test.py

Issue 14218004: Devserver: only populate data during cron jobs, meaning all data from instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integration test Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/github_file_system.py ('k') | chrome/common/extensions/docs/server2/handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698