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

Unified Diff: tools/json_schema_compiler/json_schema_test.py

Issue 10108005: Make json_schema_compiler remove 'nocompile' nodes from JSON at the JSON level (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoz Created 8 years, 8 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/json_schema.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/json_schema_test.py
diff --git a/tools/json_schema_compiler/json_schema_test.py b/tools/json_schema_compiler/json_schema_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..305431bb16c768a5f294bfb9c571039bd4478fc0
--- /dev/null
+++ b/tools/json_schema_compiler/json_schema_test.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from json_schema import CachedLoad
+import json_schema_test
+import unittest
+
+class JsonSchemaUnittest(unittest.TestCase):
+ def testNocompile(self):
+ compiled = [
+ {
+ "namespace": "compile",
+ "functions": [],
+ "types": {}
+ },
+
+ {
+ "namespace": "functions",
+ "functions": [
+ {
+ "id": "two"
+ },
+ {
+ "id": "four"
+ }
+ ],
+
+ "types": {
+ "one": { "key": "value" }
+ }
+ },
+
+ {
+ "namespace": "types",
+ "functions": [
+ { "id": "one" }
+ ],
+ "types": {
+ "two": {
+ "key": "value"
+ },
+ "four": {
+ "key": "value"
+ }
+ }
+ },
+
+ {
+ "namespace": "nested",
+ "properties": {
+ "sync": {
+ "functions": [
+ {
+ "id": "two"
+ },
+ {
+ "id": "four"
+ }
+ ],
+ "types": {
+ "two": {
+ "key": "value"
+ },
+ "four": {
+ "key": "value"
+ }
+ }
+ }
+ }
+ }
+ ]
+
+ self.assertEquals(compiled, CachedLoad('test/json_schema_test.json'))
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « tools/json_schema_compiler/json_schema.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698