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

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

Issue 255473003: docserver: Adds "API scheduled for Chrome version..." text to dev and beta APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleans up style Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/api_data_source_test.py
diff --git a/chrome/common/extensions/docs/server2/api_data_source_test.py b/chrome/common/extensions/docs/server2/api_data_source_test.py
index 478226df0c3b985e88ace95e1f9380cfba93df10..b368182ade1cceaecce8519247c7a3ae44b0b3fd 100755
--- a/chrome/common/extensions/docs/server2/api_data_source_test.py
+++ b/chrome/common/extensions/docs/server2/api_data_source_test.py
@@ -42,6 +42,12 @@ class _FakeAvailabilityFinder(object):
return ChannelInfo('stable', '396', 5)
+class _FakeScheduledAvailabilityFinder(object):
+
+ def GetApiAvailability(self, version):
+ return ChannelInfo('dev', '1500', 28, 28)
+
+
class _FakeTemplateCache(object):
def GetFromFile(self, key):
@@ -142,7 +148,8 @@ class APIDataSourceTest(unittest.TestCase):
'content': [
{ 'partial': 'handlebar chrome/common/extensions/docs/' +
'templates/private/intro_tables/stable_message.html',
- 'version': 5
+ 'version': 5,
+ 'scheduled': None
}
]
},
@@ -171,6 +178,25 @@ class APIDataSourceTest(unittest.TestCase):
]
self.assertEquals(model._GetIntroTableList(), expected_list)
+ # Tests the same data with a scheduled availability.
+ model = _JSCModel(self._api_models.GetModel('tester').Get(),
+ _FakeScheduledAvailabilityFinder(),
+ self._json_cache,
+ _FakeTemplateCache(),
+ self._features_bundle,
+ None)
+ expected_list[1] = {
+ 'title': 'Availability',
+ 'content': [
+ { 'partial': 'handlebar chrome/common/extensions/docs/' +
+ 'templates/private/intro_tables/dev_message.html',
+ 'version': 28,
+ 'scheduled': 28
+ }
+ ]
+ }
+ self.assertEquals(model._GetIntroTableList(), expected_list)
+
def testGetEventByNameFromEvents(self):
events = {}
# Missing 'types' completely.

Powered by Google App Engine
This is Rietveld 408576698