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

Unified Diff: tools/json_schema_compiler/json_schema_test.py

Issue 682493002: Remove the dependency on json schema compiler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 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/memoize.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
deleted file mode 100755
index edbb06e5aa17338acc2f1f774a29962d9a0d3ab6..0000000000000000000000000000000000000000
--- a/tools/json_schema_compiler/json_schema_test.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/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.
-
-import json_schema
-import unittest
-
-class JsonSchemaUnittest(unittest.TestCase):
- def testNocompile(self):
- compiled = [
- {
- "namespace": "compile",
- "description": "The compile API.",
- "functions": [],
- "types": {}
- },
-
- {
- "namespace": "functions",
- "description": "The functions API.",
- "functions": [
- {
- "id": "two"
- },
- {
- "id": "four"
- }
- ],
-
- "types": {
- "one": { "key": "value" }
- }
- },
-
- {
- "namespace": "types",
- "description": "The types API.",
- "functions": [
- { "id": "one" }
- ],
- "types": {
- "two": {
- "key": "value"
- },
- "four": {
- "key": "value"
- }
- }
- },
-
- {
- "namespace": "nested",
- "description": "The nested API.",
- "properties": {
- "sync": {
- "functions": [
- {
- "id": "two"
- },
- {
- "id": "four"
- }
- ],
- "types": {
- "two": {
- "key": "value"
- },
- "four": {
- "key": "value"
- }
- }
- }
- }
- }
- ]
-
- schema = json_schema.CachedLoad('test/json_schema_test.json')
- self.assertEquals(compiled, json_schema.DeleteNodes(schema, 'nocompile'))
-
- def should_delete(value):
- return isinstance(value, dict) and not value.get('valid', True)
- expected = [
- {'one': {'test': 'test'}},
- {'valid': True},
- {}
- ]
- given = [
- {'one': {'test': 'test'}, 'two': {'valid': False}},
- {'valid': True},
- {},
- {'valid': False}
- ]
- self.assertEquals(
- expected, json_schema.DeleteNodes(given, matcher=should_delete))
-
-
-if __name__ == '__main__':
- unittest.main()
« no previous file with comments | « tools/json_schema_compiler/json_schema.py ('k') | tools/json_schema_compiler/memoize.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698