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

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

Issue 10500004: Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: TemplateFetcher now has dictionary interface 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/local_fetcher_test.py
diff --git a/chrome/common/extensions/docs/server2/local_fetcher_test.py b/chrome/common/extensions/docs/server2/local_fetcher_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..5e9bf8e61946bfc16f914716edafa46b8d9d6ac9
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/local_fetcher_test.py
@@ -0,0 +1,23 @@
+#!/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 os
+import unittest
+
+from local_fetcher import LocalFetcher
+
+class LocalFetcherTest(unittest.TestCase):
+ def testFetchResource(self):
+ fetcher = LocalFetcher('')
+ local_path = os.path.join('test_data', 'local_fetcher')
+ self.assertEquals('test1\n', fetcher.FetchResource('',
+ os.path.join(local_path, 'test1.txt')).content)
+ self.assertEquals('test2\n', fetcher.FetchResource('',
+ os.path.join(local_path, 'test2.txt')).content)
+ self.assertEquals('test3\n', fetcher.FetchResource('junk',
+ os.path.join(local_path, 'test3.txt')).content)
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698