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

Side by Side Diff: chrome/common/extensions/docs/server2/template_utility_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: Added parens 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 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 os
7 import unittest
8 import test_urlfetch
9
10 from template_utility import TemplateUtility
11 from third_party.handlebar import Handlebar
12
13 def _ReadFile(filename):
14 with open(os.path.join('test_data', 'template_utility', filename), 'r') as f:
15 return f.read()
16
17 class TemplateUtilityTest(unittest.TestCase):
18 def _RenderTest(self, base):
19 template = Handlebar(_ReadFile(base + '_tmpl.html'))
20 self.assertEquals(_ReadFile(base + '.html'),
21 self.t_util.RenderTemplate(template, _ReadFile(base + '.json')))
22
23 def testRenderTemplate(self):
24 self.t_util = TemplateUtility()
25 self._RenderTest('test1')
26 self._RenderTest('test2')
27
28 if __name__ == '__main__':
29 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698