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

Side by Side 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: 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 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 from json_schema import CachedLoad
7 import json_schema_test
8 import unittest
9
10 class JsonSchemaUnittest(unittest.TestCase):
11 def testNocompile(self):
12 compiled = [
13 {
14 "namespace": "compile",
15 "functions": [],
16 "types": {}
17 },
18
19 {
20 "namespace": "functions",
21 "functions": [
22 {
23 "id": "two"
24 },
25 {
26 "id": "four"
27 }
28 ],
29
30 "types": {
31 "one": { "key": "value" }
32 }
33 },
34
35 {
36 "namespace": "types",
37 "functions": [
38 { "id": "one" }
39 ],
40 "types": {
41 "two": {
42 "key": "value"
43 },
44 "four": {
45 "key": "value"
46 }
47 }
48 },
49
50 {
51 "namespace": "nested",
52 "properties": {
53 "sync": {
54 "functions": [
55 {
56 "id": "two"
57 },
58 {
59 "id": "four"
60 }
61 ],
62 "types": {
63 "two": {
64 "key": "value"
65 },
66 "four": {
67 "key": "value"
68 }
69 }
70 }
71 }
72 }
73 ]
74
75 self.assertEquals(compiled, CachedLoad('test/json_schema_test.json'))
76
77 if __name__ == '__main__':
78 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698