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

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

Issue 10387225: Die build.py, Die: Part 1 (BranchUtility and SubversionFetcher) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Final changes Created 8 years, 7 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
new file mode 100755
index 0000000000000000000000000000000000000000..3fab9f706f909a05c6ae82441f8d6f0d7c17f668
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/branch_utility_test.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+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(
+ 'dev/hello/stuff.html'))
+ self.assertEquals('beta', b_util.GetChannelNameFromPath(
+ 'beta/hello/stuff.html'))
+ self.assertEquals('trunk', b_util.GetChannelNameFromPath(
+ 'trunk/hello/stuff.html'))
+ self.assertEquals('stable', b_util.GetChannelNameFromPath(
+ 'hello/stuff.html'))
+ self.assertEquals('stable', b_util.GetChannelNameFromPath(
+ 'hello/dev/stuff.html'))
+
+ def testGetBranchNumberForChannelName(self):
+ b_util = BranchUtility(test_urlfetch)
+ b_util.SetURL('branch_utility/first.json')
+ self.assertEquals('1132',
+ b_util.GetBranchNumberForChannelName('dev'))
+ self.assertEquals('1084',
+ b_util.GetBranchNumberForChannelName('beta'))
+ self.assertEquals('1234',
+ b_util.GetBranchNumberForChannelName('stable'))
+ self.assertEquals('trunk',
+ b_util.GetBranchNumberForChannelName('trunk'))
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « chrome/common/extensions/docs/server2/branch_utility.py ('k') | chrome/common/extensions/docs/server2/echo_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698