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 81743175517076365993bab077fd08c818d56486..27cdaf12f5eecf76f1169f379d58a175068b4c35 100755 |
--- a/tools/json_schema_compiler/idl_schema_test.py |
+++ b/tools/json_schema_compiler/idl_schema_test.py |
@@ -100,6 +100,25 @@ class IdlSchemaTest(unittest.TestCase): |
'type': 'array'}] |
self.assertEquals(expected, getParams(schema, 'function14')) |
+ def testScopedArguments(self): |
+ schema = self.idl_basics |
+ expected = [{'name':'value', '$ref':'other_namespace.SomeType'}] |
not at google - send to devlin
2014/03/17 14:00:29
nit: spaces after the : (this file is oddly incons
mtomasz
2014/03/28 04:48:31
Done.
|
+ self.assertEquals(expected, getParams(schema, 'function20')) |
+ |
+ expected = [{'items': {'$ref': 'other_namespace.SomeType'}, |
+ 'name': 'values', |
+ 'type': 'array'}] |
+ self.assertEquals(expected, getParams(schema, 'function21')) |
+ |
+ expected = [{'name':'value', |
+ '$ref':'other_namespace.sub_namespace.SomeType'}] |
+ self.assertEquals(expected, getParams(schema, 'function22')) |
+ |
+ expected = [{'items': {'$ref': 'other_namespace.sub_namespace.SomeType'}, |
+ 'name': 'values', |
+ 'type': 'array'}] |
+ self.assertEquals(expected, getParams(schema, 'function23')) |
+ |
def testNoCompile(self): |
schema = self.idl_basics |
func = getFunction(schema, 'function15') |
@@ -120,20 +139,26 @@ class IdlSchemaTest(unittest.TestCase): |
def testReturnTypes(self): |
schema = self.idl_basics |
- self.assertEquals({'name': 'function19', 'type': 'integer'}, |
- getReturns(schema, 'function19')) |
- self.assertEquals({'name': 'function20', '$ref': 'MyType1', |
+ self.assertEquals({'name': 'function24', 'type': 'integer'}, |
+ getReturns(schema, 'function24')) |
+ self.assertEquals({'name': 'function25', '$ref': 'MyType1', |
'optional': True}, |
- getReturns(schema, 'function20')) |
- self.assertEquals({'name': 'function21', 'type': 'array', |
+ getReturns(schema, 'function25')) |
+ self.assertEquals({'name': 'function26', 'type': 'array', |
'items': {'$ref': 'MyType1'}}, |
- getReturns(schema, 'function21')) |
- self.assertEquals({'name': 'function22', '$ref': 'EnumType', |
+ getReturns(schema, 'function26')) |
+ self.assertEquals({'name': 'function27', '$ref': 'EnumType', |
'optional': True}, |
- getReturns(schema, 'function22')) |
- self.assertEquals({'name': 'function23', 'type': 'array', |
+ getReturns(schema, 'function27')) |
+ self.assertEquals({'name': 'function28', 'type': 'array', |
'items': {'$ref': 'EnumType'}}, |
- getReturns(schema, 'function23')) |
+ getReturns(schema, 'function28')) |
+ self.assertEquals({'name': 'function29', '$ref': 'other_namespace.SomeType', |
+ 'optional': True}, |
+ getReturns(schema, 'function29')) |
+ self.assertEquals({'name': 'function30', 'type': 'array', |
+ 'items': {'$ref': 'other_namespace.SomeType'}}, |
+ getReturns(schema, 'function30')) |
def testChromeOSPlatformsNamespace(self): |
schema = idl_schema.Load('test/idl_namespace_chromeos.idl')[0] |