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

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

Issue 10545043: Extensions docs server: Design changes, partial template support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made suggested changes Created 8 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/branch_utility_test.py
diff --git a/chrome/common/extensions/docs/server2/branch_utility_test.py b/chrome/common/extensions/docs/server2/branch_utility_test.py
index 3fab9f706f909a05c6ae82441f8d6f0d7c17f668..ee5728cecabaef8f0d4dedaa2e18651c23ec09cc 100755
--- a/chrome/common/extensions/docs/server2/branch_utility_test.py
+++ b/chrome/common/extensions/docs/server2/branch_utility_test.py
@@ -3,36 +3,41 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import branch_utility
import unittest
import test_urlfetch
-from branch_utility import BranchUtility
-
class BranchUtilityTest(unittest.TestCase):
def testGetChannelNameFromPath(self):
- b_util = BranchUtility(test_urlfetch)
- self.assertEquals('dev', b_util.GetChannelNameFromPath(
+ self.assertEquals('dev', branch_utility.GetChannelNameFromPath(
'dev/hello/stuff.html'))
- self.assertEquals('beta', b_util.GetChannelNameFromPath(
+ self.assertEquals('beta', branch_utility.GetChannelNameFromPath(
'beta/hello/stuff.html'))
- self.assertEquals('trunk', b_util.GetChannelNameFromPath(
+ self.assertEquals('trunk', branch_utility.GetChannelNameFromPath(
'trunk/hello/stuff.html'))
- self.assertEquals('stable', b_util.GetChannelNameFromPath(
+ self.assertEquals('stable', branch_utility.GetChannelNameFromPath(
'hello/stuff.html'))
- self.assertEquals('stable', b_util.GetChannelNameFromPath(
+ self.assertEquals('stable', branch_utility.GetChannelNameFromPath(
'hello/dev/stuff.html'))
def testGetBranchNumberForChannelName(self):
- b_util = BranchUtility(test_urlfetch)
- b_util.SetURL('branch_utility/first.json')
+ base_path = 'branch_utility/first.json'
self.assertEquals('1132',
- b_util.GetBranchNumberForChannelName('dev'))
+ branch_utility.GetBranchNumberForChannelName('dev',
+ test_urlfetch,
+ base_path))
self.assertEquals('1084',
- b_util.GetBranchNumberForChannelName('beta'))
+ branch_utility.GetBranchNumberForChannelName('beta',
+ test_urlfetch,
+ base_path))
self.assertEquals('1234',
- b_util.GetBranchNumberForChannelName('stable'))
+ branch_utility.GetBranchNumberForChannelName('stable',
+ test_urlfetch,
+ base_path))
self.assertEquals('trunk',
- b_util.GetBranchNumberForChannelName('trunk'))
+ branch_utility.GetBranchNumberForChannelName('trunk',
+ test_urlfetch,
+ base_path))
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698