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

Unified Diff: chrome/common/extensions/docs/server2/cron_servlet_test.py

Issue 18323018: Linking AvailabilityFinder with APIDataSource and intro-table templates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More Generic Templates Created 7 years, 5 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
Index: chrome/common/extensions/docs/server2/cron_servlet_test.py
diff --git a/chrome/common/extensions/docs/server2/cron_servlet_test.py b/chrome/common/extensions/docs/server2/cron_servlet_test.py
index 7c706920b8c58c63cab3e8a941a15ab193ec0c2b..ec20683646fed44964be352de88bc7fcc2c79b65 100755
--- a/chrome/common/extensions/docs/server2/cron_servlet_test.py
+++ b/chrome/common/extensions/docs/server2/cron_servlet_test.py
@@ -7,7 +7,6 @@ import unittest
from appengine_wrappers import GetAppVersion
from app_yaml_helper import AppYamlHelper
-from caching_file_system import CachingFileSystem
from cron_servlet import CronServlet
from empty_dir_file_system import EmptyDirFileSystem
from host_file_system_creator import HostFileSystemCreator
@@ -57,10 +56,17 @@ class CronServletTest(unittest.TestCase):
delegate = _TestDelegate(
lambda _, __: MockFileSystem(LocalFileSystem.Create()))
+ # A file system will be created for the server instance, and one
+ # will also be created by AvailabilityFinder for each version from trunk, to
+ # version 28 (dev), down to and including version 17. This amounts to 14
+ # total. The dev version is determined by the test data that
+ # TestBranchUtility has access to. Version 17 is where AvailabilityFinder
+ # halts during tests.
+ num_file_systems = 14
epeterson 2013/07/16 00:28:23 This is a pretty magical number. I mean, anything
not at google - send to devlin 2013/07/16 22:25:00 Ok maybe the answer here is just the test isn't me
epeterson 2013/07/17 23:48:23 That seems ok.
# Test that the cron runs successfully.
response = CronServlet(Request.ForTest('trunk'),
delegate_for_test=delegate).Get()
- self.assertEqual(1, len(delegate.file_systems))
+ self.assertEqual(num_file_systems, len(delegate.file_systems))
self.assertEqual(200, response.status)
# When re-running, all file systems should be Stat()d the same number of
@@ -68,10 +74,11 @@ class CronServletTest(unittest.TestCase):
# Stats haven't changed.
response = CronServlet(Request.ForTest('trunk'),
delegate_for_test=delegate).Get()
- self.assertEqual(2, len(delegate.file_systems))
- self.assertTrue(*delegate.file_systems[1].CheckAndReset(
- read_count=0,
- stat_count=delegate.file_systems[0].GetStatCount()))
+ self.assertEqual(num_file_systems * 2, len(delegate.file_systems))
+ for x in range (0, num_file_systems):
+ self.assertTrue(*delegate.file_systems[x + num_file_systems]
+ .CheckAndReset(read_count=0,
+ stat_count=delegate.file_systems[x].GetStatCount()))
def testSafeRevision(self):
test_data = {

Powered by Google App Engine
This is Rietveld 408576698