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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import unittest
7 import test_urlfetch
8
9 from branch_utility import BranchUtility
10
11 class BranchUtilityTest(unittest.TestCase):
12 def testGetChannelNameFromPath(self):
13 b_util = BranchUtility(test_urlfetch)
14 self.assertEquals('dev', b_util.GetChannelNameFromPath(
15 'dev/hello/stuff.html'))
16 self.assertEquals('beta', b_util.GetChannelNameFromPath(
17 'beta/hello/stuff.html'))
18 self.assertEquals('trunk', b_util.GetChannelNameFromPath(
19 'trunk/hello/stuff.html'))
20 self.assertEquals('stable', b_util.GetChannelNameFromPath(
21 'hello/stuff.html'))
22 self.assertEquals('stable', b_util.GetChannelNameFromPath(
23 'hello/dev/stuff.html'))
24
25 def testGetBranchNumberForChannelName(self):
26 b_util = BranchUtility(test_urlfetch)
27 b_util.SetURL('branch_utility/first.json')
28 self.assertEquals('1132',
29 b_util.GetBranchNumberForChannelName('dev'))
30 self.assertEquals('1084',
31 b_util.GetBranchNumberForChannelName('beta'))
32 self.assertEquals('1234',
33 b_util.GetBranchNumberForChannelName('stable'))
34 self.assertEquals('trunk',
35 b_util.GetBranchNumberForChannelName('trunk'))
36
37 if __name__ == '__main__':
38 unittest.main()
OLDNEW
« 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