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

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

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up Created 8 years, 5 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 df872d22fd30673c7256e555f1ba2ae5b1309070..ebfceca04f71fb28e0643dadc23a4e7de3e7d8c2 100755
--- a/chrome/common/extensions/docs/server2/branch_utility_test.py
+++ b/chrome/common/extensions/docs/server2/branch_utility_test.py
@@ -3,46 +3,44 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import branch_utility
+from branch_utility import BranchUtility
+from fake_url_fetcher import FakeUrlFetcher
+from in_memory_memcache import InMemoryMemcache
import unittest
-import test_urlfetch
class BranchUtilityTest(unittest.TestCase):
+ def setUp(self):
+ self._branch_util = BranchUtility('branch_utility/first.json',
+ 'stable',
+ FakeUrlFetcher('test_data'),
+ InMemoryMemcache())
+
def testSplitChannelNameFromPath(self):
self.assertEquals(('dev', 'hello/stuff.html'),
- branch_utility.SplitChannelNameFromPath(
+ self._branch_util.SplitChannelNameFromPath(
'dev/hello/stuff.html'))
self.assertEquals(('beta', 'hello/stuff.html'),
- branch_utility.SplitChannelNameFromPath(
+ self._branch_util.SplitChannelNameFromPath(
'beta/hello/stuff.html'))
self.assertEquals(('trunk', 'hello/stuff.html'),
- branch_utility.SplitChannelNameFromPath(
+ self._branch_util.SplitChannelNameFromPath(
'trunk/hello/stuff.html'))
self.assertEquals(('stable', 'hello/stuff.html'),
- branch_utility.SplitChannelNameFromPath(
+ self._branch_util.SplitChannelNameFromPath(
'hello/stuff.html'))
self.assertEquals(('stable', 'hello/dev/stuff.html'),
- branch_utility.SplitChannelNameFromPath(
+ self._branch_util.SplitChannelNameFromPath(
'hello/dev/stuff.html'))
def testGetBranchNumberForChannelName(self):
- base_path = 'branch_utility/first.json'
self.assertEquals('1132',
- branch_utility.GetBranchNumberForChannelName('dev',
- test_urlfetch,
- base_path))
+ self._branch_util.GetBranchNumberForChannelName('dev'))
self.assertEquals('1084',
- branch_utility.GetBranchNumberForChannelName('beta',
- test_urlfetch,
- base_path))
+ self._branch_util.GetBranchNumberForChannelName('beta'))
self.assertEquals('1234',
- branch_utility.GetBranchNumberForChannelName('stable',
- test_urlfetch,
- base_path))
+ self._branch_util.GetBranchNumberForChannelName('stable'))
self.assertEquals('trunk',
- branch_utility.GetBranchNumberForChannelName('trunk',
- test_urlfetch,
- base_path))
+ self._branch_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/build_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698