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

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

Issue 10689144: Extensions Docs Server: Samples zip files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up and tests 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/subversion_fetcher_test.py
diff --git a/chrome/common/extensions/docs/server2/subversion_fetcher_test.py b/chrome/common/extensions/docs/server2/subversion_fetcher_test.py
index 64c8776ab4fc6edb956576e30f13c8ac5bcb098a..caea496ea4a1b5b96ce92c8ec6e7aa20ac40868c 100755
--- a/chrome/common/extensions/docs/server2/subversion_fetcher_test.py
+++ b/chrome/common/extensions/docs/server2/subversion_fetcher_test.py
@@ -11,11 +11,8 @@ from subversion_fetcher import SubversionFetcher
class TestSubversionFetcher(SubversionFetcher):
def _GetURLFromBranch(self, branch):
- if branch == 'trunk':
- return os.path.join('subversion_fetcher', 'trunk')
return os.path.join('subversion_fetcher', branch)
-
class SubversionFetcherTest(unittest.TestCase):
def testFetchResource(self):
fetcher_t = TestSubversionFetcher('trunk', '', test_urlfetch)
@@ -28,5 +25,17 @@ class SubversionFetcherTest(unittest.TestCase):
self.assertEquals('branch2 test\n',
fetcher_b2.FetchResource('/test.txt').content)
+ def testListDirectory(self):
+ fetcher = TestSubversionFetcher('trunk', '', test_urlfetch)
+ expected = ['file%d.html' % i for i in range(7)]
+ self.assertEquals(
+ expected,
+ fetcher.ListDirectory('recursive_list/list').content)
+ expected2 = ['recursive_list.html/' + x for x in expected]
+ expected2.extend(['recursive_list.html/list/' + x for x in expected])
+ self.assertEquals(
+ expected2,
+ fetcher.ListDirectory('recursive_list.html', recursive=True).content)
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698