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

Side by Side Diff: lib/html/scripts/dartgenerator_test.py

Issue 11238007: Discard modules information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | lib/html/scripts/databasebuilder.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """Tests for dartgenerator.""" 6 """Tests for dartgenerator."""
7 7
8 import logging.config 8 import logging.config
9 import os.path 9 import os.path
10 import re 10 import re
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 module lines { 116 module lines {
117 @A1 117 @A1
118 interface Line : shapes::Shape { 118 interface Line : shapes::Shape {
119 }; 119 };
120 }; 120 };
121 """ 121 """
122 122
123 parser = idlparser.IDLParser(idlparser.FREMONTCUT_SYNTAX) 123 parser = idlparser.IDLParser(idlparser.FREMONTCUT_SYNTAX)
124 ast = parser.parse(content) 124 ast = parser.parse(content)
125 idl_file = idlnode.IDLFile(ast) 125 idl_file = idlnode.IDLFile(ast)
126 for module in idl_file.modules: 126 for interface in idl_file.interfaces:
127 module_name = module.id 127 db.AddInterface(interface)
128 for interface in module.interfaces:
129 db.AddInterface(interface)
130 db.Save() 128 db.Save()
131 129
132 self.assertTrue(self._InDatabase('Shape')) 130 self.assertTrue(self._InDatabase('Shape'))
133 self.assertTrue(self._InDatabase('Rectangle')) 131 self.assertTrue(self._InDatabase('Rectangle'))
134 self.assertTrue(self._InDatabase('Line')) 132 self.assertTrue(self._InDatabase('Line'))
135 133
136 self._database = database.Database(self._database_dir) 134 self._database = database.Database(self._database_dir)
137 self._generator = dartgenerator.DartGenerator(self._auxiliary_dir, 135 self._generator = dartgenerator.DartGenerator(self._auxiliary_dir,
138 '../templates', 136 '../templates',
139 'test') 137 'test')
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 # Verify template conversion: 227 # Verify template conversion:
230 # TODO(vsm): Re-enable when core collections are supported. 228 # TODO(vsm): Re-enable when core collections are supported.
231 # self._AssertOutputContains('rectangles', 'Rectangle', 229 # self._AssertOutputContains('rectangles', 'Rectangle',
232 # 'void someTemplatedType(List<Shape> list)') 230 # 'void someTemplatedType(List<Shape> list)')
233 231
234 232
235 if __name__ == '__main__': 233 if __name__ == '__main__':
236 logging.config.fileConfig('logging.conf') 234 logging.config.fileConfig('logging.conf')
237 if __name__ == '__main__': 235 if __name__ == '__main__':
238 unittest.main() 236 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | lib/html/scripts/databasebuilder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698