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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 1051563002: Support JSON Schema properties with values in the JSON Schema Compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assertr Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/idl_schema.py ('k') | tools/json_schema_compiler/test/idl_properties.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/idl_schema_test.py
diff --git a/tools/json_schema_compiler/idl_schema_test.py b/tools/json_schema_compiler/idl_schema_test.py
index a0457167134b5a2306b385ad20aa1106131ccefd..03960c3b029a0cff9d8ae1477452c4ffb3290be2 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -391,6 +391,30 @@ class IdlSchemaTest(unittest.TestCase):
self.assertEquals(expected, badabish_params)
+ def testProperties(self):
+ schema = idl_schema.Load('test/idl_properties.idl')[0]
+ self.assertEquals(OrderedDict([
+ ('first', OrderedDict([
+ ('description', 'Integer property.'),
+ ('type', 'integer'),
+ ('value', 42),
+ ])),
+ ('second', OrderedDict([
+ ('description', 'Double property.'),
+ ('type', 'number'),
+ ('value', 42.0),
+ ])),
+ ('third', OrderedDict([
+ ('description', 'String property.'),
+ ('type', 'string'),
+ ('value', 'hello world'),
+ ])),
+ ('fourth', OrderedDict([
+ ('description', 'Unvalued property.'),
+ ('type', 'integer'),
+ ])),
+ ]), schema.get('properties'))
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tools/json_schema_compiler/idl_schema.py ('k') | tools/json_schema_compiler/test/idl_properties.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698