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

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: Rebase with master 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..a5fb6224d291093b742dbb2946a3ad0f7893f0aa 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
@@ -60,18 +59,24 @@ class CronServletTest(unittest.TestCase):
# 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(200, response.status)
+ # Save the file systems created, start with a fresh set for the next run.
+ first_run_file_systems = delegate.file_systems[:]
+ delegate.file_systems[:] = []
+
# When re-running, all file systems should be Stat()d the same number of
# times, but the second round shouldn't have been re-Read() since the
# 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(200, response.status)
+
+ self.assertEqual(len(first_run_file_systems), len(delegate.file_systems))
+ for i, second_run_file_system in enumerate(delegate.file_systems):
+ self.assertTrue(*second_run_file_system.CheckAndReset(
+ read_count=0,
+ stat_count=first_run_file_systems[i].GetStatCount()))
def testSafeRevision(self):
test_data = {
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/intro_data_source_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698