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

Unified Diff: tools/json_schema_compiler/schema_util_test.py

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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
Index: tools/json_schema_compiler/schema_util_test.py
diff --git a/tools/json_schema_compiler/schema_util_test.py b/tools/json_schema_compiler/schema_util_test.py
index 1fa1803c3f6320fd0afea424f814bc75c3bc7c52..4db88f1922f88f01a458881883544586c70a905d 100755
--- a/tools/json_schema_compiler/schema_util_test.py
+++ b/tools/json_schema_compiler/schema_util_test.py
@@ -4,7 +4,6 @@
# found in the LICENSE file.
from schema_util import JsFunctionNameToClassName
-from schema_util import PrefixSchemasWithNamespace
from schema_util import StripSchemaNamespace
import unittest
@@ -13,59 +12,6 @@ class SchemaUtilTest(unittest.TestCase):
self.assertEquals('Bar', StripSchemaNamespace('foo.Bar'))
self.assertEquals('Baz', StripSchemaNamespace('Baz'))
- def testPrefixSchemasWithNamespace(self):
- schemas = [
- { 'namespace': 'n1',
- 'types': [
- {
- 'id': 'T1',
- 'customBindings': 'T1',
- 'properties': {
- 'p1': {'$ref': 'T1'},
- 'p2': {'$ref': 'fully.qualified.T'},
- }
- }
- ],
- 'functions': [
- {
- 'parameters': [
- { '$ref': 'T1' },
- { '$ref': 'fully.qualified.T' },
- ],
- 'returns': { '$ref': 'T1' }
- },
- ],
- 'events': [
- {
- 'parameters': [
- { '$ref': 'T1' },
- { '$ref': 'fully.qualified.T' },
- ],
- },
- ],
- },
- ]
- PrefixSchemasWithNamespace(schemas)
- self.assertEquals('n1.T1', schemas[0]['types'][0]['id'])
- self.assertEquals('n1.T1', schemas[0]['types'][0]['customBindings'])
- self.assertEquals('n1.T1',
- schemas[0]['types'][0]['properties']['p1']['$ref'])
- self.assertEquals('fully.qualified.T',
- schemas[0]['types'][0]['properties']['p2']['$ref'])
-
- self.assertEquals('n1.T1',
- schemas[0]['functions'][0]['parameters'][0]['$ref'])
- self.assertEquals('fully.qualified.T',
- schemas[0]['functions'][0]['parameters'][1]['$ref'])
- self.assertEquals('n1.T1',
- schemas[0]['functions'][0]['returns']['$ref'])
-
- self.assertEquals('n1.T1',
- schemas[0]['events'][0]['parameters'][0]['$ref'])
- self.assertEquals('fully.qualified.T',
- schemas[0]['events'][0]['parameters'][1]['$ref'])
-
-
def testJsFunctionNameToClassName(self):
self.assertEquals('FooBar', JsFunctionNameToClassName('foo', 'bar'))
self.assertEquals('FooBar',
« no previous file with comments | « tools/json_schema_compiler/schema_util.py ('k') | tools/json_schema_compiler/test/additional_properties.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698