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

Side by Side Diff: chrome/common/extensions/docs/server2/template_data_source_test.py

Issue 10834144: Extensions Docs Server: Split apps from extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import json 6 import json
7 import os 7 import os
8 import unittest 8 import unittest
9 9
10 from file_system_cache import FileSystemCache 10 from file_system_cache import FileSystemCache
(...skipping 29 matching lines...) Expand all
40 40
41 def _RenderTest(self, name, data_source): 41 def _RenderTest(self, name, data_source):
42 template_name = name + '_tmpl.html' 42 template_name = name + '_tmpl.html'
43 template = Handlebar(self._ReadLocalFile(template_name)) 43 template = Handlebar(self._ReadLocalFile(template_name))
44 self.assertEquals( 44 self.assertEquals(
45 self._ReadLocalFile(name + '_expected.html'), 45 self._ReadLocalFile(name + '_expected.html'),
46 data_source.Render(template_name)) 46 data_source.Render(template_name))
47 47
48 def _CreateTemplateDataSource(self, input_dict, cache_builder): 48 def _CreateTemplateDataSource(self, input_dict, cache_builder):
49 return (TemplateDataSource.Factory('fake_branch', 49 return (TemplateDataSource.Factory('fake_branch',
50 'extensions',
50 _FakeApiDataSourceFactory(input_dict), 51 _FakeApiDataSourceFactory(input_dict),
51 self._fake_api_list_data_source, 52 self._fake_api_list_data_source,
52 self._fake_intro_data_source, 53 self._fake_intro_data_source,
53 self._fake_samples_data_source, 54 self._fake_samples_data_source,
54 cache_builder, 55 cache_builder,
55 './', 56 './',
56 './') 57 './')
57 .Create(_FakeRequest())) 58 .Create(_FakeRequest()))
58 59
59 def testSimple(self): 60 def testSimple(self):
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 json.loads(self._ReadLocalFile('test1.json')), 95 json.loads(self._ReadLocalFile('test1.json')),
95 cache_builder)) 96 cache_builder))
96 self._RenderTest( 97 self._RenderTest(
97 'test2', 98 'test2',
98 self._CreateTemplateDataSource( 99 self._CreateTemplateDataSource(
99 json.loads(self._ReadLocalFile('test2.json')), 100 json.loads(self._ReadLocalFile('test2.json')),
100 cache_builder)) 101 cache_builder))
101 102
102 if __name__ == '__main__': 103 if __name__ == '__main__':
103 unittest.main() 104 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698