Index: chrome/common/extensions/docs/server2/template_utility_test.py |
diff --git a/chrome/common/extensions/docs/server2/template_utility_test.py b/chrome/common/extensions/docs/server2/template_utility_test.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..7d813b36f69002154577c30b943e8aef06a45c68 |
--- /dev/null |
+++ b/chrome/common/extensions/docs/server2/template_utility_test.py |
@@ -0,0 +1,28 @@ |
+#!/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 unittest |
+import test_urlfetch |
+ |
+from template_utility import TemplateUtility |
+ |
+def _ReadFile(filename): |
+ with open('test_data/template_utility/' + filename) as f: |
+ return f.read() |
+ |
+ |
+class TemplateUtilityTest(unittest.TestCase): |
+ def _RenderTest(self, base): |
+ self.assertEquals(_ReadFile(base + '.html'), |
+ self.t_util.RenderTemplate(_ReadFile(base + '.tmpl'), |
+ _ReadFile(base + '.json'))) |
+ |
+ def testRenderTemplate(self): |
+ self.t_util = TemplateUtility() |
+ self._RenderTest('test1') |
+ self._RenderTest('test2') |
+ |
+if __name__ == '__main__': |
+ unittest.main() |