Chromium Code Reviews| 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
|