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

Side by Side Diff: chrome/common/extensions/docs/server2/resource_fetcher_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 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 resource_fetcher import SubversionFetcher
10
11 class TestSubversionFetcher(SubversionFetcher):
12 def _GetURLFromBranch(self, branch):
13 if branch == 'trunk':
14 return 'subversion_fetcher/trunk/'
15 return 'subversion_fetcher/' + branch + '/'
16
17 class SubversionFetcherTest(unittest.TestCase):
18 def testFetchResource(self):
19 s_fetcher = TestSubversionFetcher(test_urlfetch)
20 self.assertEquals('trunk test\n',
21 s_fetcher.FetchResource('trunk', 'test.json').content)
22 self.assertEquals('branch1 test\n',
23 s_fetcher.FetchResource('branch1', 'test.json').content)
24 self.assertEquals('branch2 test\n',
25 s_fetcher.FetchResource('branch2', 'test.json').content)
26
27 if __name__ == '__main__':
28 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698