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

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

Issue 10831269: Extensions Docs Server: BranchUtility not fetching branch numbers correctly (fixed) (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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 _FakeApiDataSourceFactory(input_dict), 50 _FakeApiDataSourceFactory(input_dict),
51 self._fake_api_list_data_source, 51 self._fake_api_list_data_source,
52 self._fake_intro_data_source, 52 self._fake_intro_data_source,
53 self._fake_samples_data_source, 53 self._fake_samples_data_source,
54 cache_builder, 54 cache_builder,
55 '.', 55 '.',
56 '.') 56 '.')
57 .Create(_FakeRequest())) 57 .Create(_FakeRequest(), 'fake_branch'))
58 58
59 def testSimple(self): 59 def testSimple(self):
60 self._base_path = os.path.join(self._base_path, 'simple') 60 self._base_path = os.path.join(self._base_path, 'simple')
61 fetcher = LocalFileSystem(self._base_path) 61 fetcher = LocalFileSystem(self._base_path)
62 cache_builder = FileSystemCache.Builder(fetcher) 62 cache_builder = FileSystemCache.Builder(fetcher)
63 t_data_source = self._CreateTemplateDataSource( 63 t_data_source = self._CreateTemplateDataSource(
64 self._fake_api_data_source_factory, cache_builder) 64 self._fake_api_data_source_factory, cache_builder)
65 template_a1 = Handlebar(self._ReadLocalFile('test1.html')) 65 template_a1 = Handlebar(self._ReadLocalFile('test1.html'))
66 self.assertEqual(template_a1.render({}, {'templates': {}}).text, 66 self.assertEqual(template_a1.render({}, {'templates': {}}).text,
67 t_data_source['test1'].render({}, {'templates': {}}).text) 67 t_data_source['test1'].render({}, {'templates': {}}).text)
(...skipping 26 matching lines...) Expand all
94 json.loads(self._ReadLocalFile('test1.json')), 94 json.loads(self._ReadLocalFile('test1.json')),
95 cache_builder)) 95 cache_builder))
96 self._RenderTest( 96 self._RenderTest(
97 'test2', 97 'test2',
98 self._CreateTemplateDataSource( 98 self._CreateTemplateDataSource(
99 json.loads(self._ReadLocalFile('test2.json')), 99 json.loads(self._ReadLocalFile('test2.json')),
100 cache_builder)) 100 cache_builder))
101 101
102 if __name__ == '__main__': 102 if __name__ == '__main__':
103 unittest.main() 103 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698