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

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

Issue 10577022: Extensions Docs Server: HandlebarDictGenerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
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 json
7 import os
8 import unittest
9
10 from dict_generator import DictGenerator
11 import third_party.json_schema_compiler.json_comment_eater as comment_eater
12 import third_party.json_schema_compiler.model as model
13
14 class DictGeneratorTest(unittest.TestCase):
15 def setUp(self):
16 self._base_path = os.path.join('test_data', 'dict_generator')
17
18 def _ReadLocalFile(self, filename):
19 with open(os.path.join(self._base_path, filename), 'r') as f:
20 return f.read()
21
22 def _GenerateTest(self, filename):
23 expected_json = json.loads(self._ReadLocalFile('expected_' + filename))
24 gen = DictGenerator(
25 json.loads(comment_eater.Nom(self._ReadLocalFile(filename)))[0])
26 self.assertEquals(expected_json, gen.Generate())
27
28
not at google - send to devlin 2012/06/19 20:33:10 extra \n ?
cduvall 2012/06/19 22:21:02 Done.
29 def testGenerate(self):
30 self._GenerateTest('bookmarks.json')
31 self._GenerateTest('browser_action.json')
32
33 if __name__ == '__main__':
34 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698