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

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

Issue 17397010: Adding AvailabilityFinder to Doc Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes, Prettifying canned_data Created 7 years, 6 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/test_branch_utility.py
diff --git a/chrome/common/extensions/docs/server2/test_branch_utility.py b/chrome/common/extensions/docs/server2/test_branch_utility.py
index aaabdcac36886148ec84f1909c8b078433c06501..96a7416269184bcbca9f1f9ff5e8f3b9d30ffd8c 100644
--- a/chrome/common/extensions/docs/server2/test_branch_utility.py
+++ b/chrome/common/extensions/docs/server2/test_branch_utility.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from branch_utility import BranchUtility, ChannelInfo
+from test_data.canned_data import (CANNED_BRANCHES, CANNED_CHANNELS)
class TestBranchUtility(object):
'''Mimics BranchUtility to return valid-ish data without needing omahaproxy
@@ -13,9 +14,13 @@ class TestBranchUtility(object):
for channel in BranchUtility.GetAllChannelNames()]
def GetChannelInfo(self, channel):
- return ChannelInfo(channel,
- 'fakebranch-%s' % channel,
- 'fakeversion-%s' % channel)
+ version = CANNED_CHANNELS[channel]
+ return ChannelInfo(channel, self.GetBranchForVersion(version), version)
def GetBranchForVersion(self, version):
- return 'fakebranch-%s' % version
+ return CANNED_BRANCHES[version]
+
+ def GetChannelForVersion(self, version):
+ for channel in CANNED_CHANNELS.iterkeys():
+ if CANNED_CHANNELS[channel] == version:
+ return channel
epeterson 2013/06/21 00:48:26 Can we reuse dicts from canned_data? This way we d
not at google - send to devlin 2013/06/21 00:54:11 answered above

Powered by Google App Engine
This is Rietveld 408576698