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

Unified Diff: tools/json_schema_compiler/schema_util_test.py

Issue 10659021: Move chrome.appWindow to chrome.app.window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years, 5 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/schema_util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ecdd17c025c4b610a7de498ba092a9b7fb5afa9a..1fa1803c3f6320fd0afea424f814bc75c3bc7c52 100755
--- a/tools/json_schema_compiler/schema_util_test.py
+++ b/tools/json_schema_compiler/schema_util_test.py
@@ -3,13 +3,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import schema_util
+from schema_util import JsFunctionNameToClassName
+from schema_util import PrefixSchemasWithNamespace
+from schema_util import StripSchemaNamespace
import unittest
class SchemaUtilTest(unittest.TestCase):
def testStripSchemaNamespace(self):
- self.assertEquals('Bar', schema_util.StripSchemaNamespace('foo.Bar'))
- self.assertEquals('Baz', schema_util.StripSchemaNamespace('Baz'))
+ self.assertEquals('Bar', StripSchemaNamespace('foo.Bar'))
+ self.assertEquals('Baz', StripSchemaNamespace('Baz'))
def testPrefixSchemasWithNamespace(self):
schemas = [
@@ -43,7 +45,7 @@ class SchemaUtilTest(unittest.TestCase):
],
},
]
- schema_util.PrefixSchemasWithNamespace(schemas)
+ PrefixSchemasWithNamespace(schemas)
self.assertEquals('n1.T1', schemas[0]['types'][0]['id'])
self.assertEquals('n1.T1', schemas[0]['types'][0]['customBindings'])
self.assertEquals('n1.T1',
@@ -63,5 +65,15 @@ class SchemaUtilTest(unittest.TestCase):
self.assertEquals('fully.qualified.T',
schemas[0]['events'][0]['parameters'][1]['$ref'])
+
+ def testJsFunctionNameToClassName(self):
+ self.assertEquals('FooBar', JsFunctionNameToClassName('foo', 'bar'))
+ self.assertEquals('FooBar',
+ JsFunctionNameToClassName('experimental.foo', 'bar'))
+ self.assertEquals('FooBarBaz',
+ JsFunctionNameToClassName('foo.bar', 'baz'))
+ self.assertEquals('FooBarBaz',
+ JsFunctionNameToClassName('experimental.foo.bar', 'baz'))
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tools/json_schema_compiler/schema_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698