
This CL is part of a larger effort to deprecate python2 in PRESUBMIT. json_schema_compiler's PRESUBMIT file will now run unit tests in python3. In order to do this, every file's #! must specify python3 (in this dir, most were ambiguous and simply said python). Bug: 1212101 Change-Id: I870ac1cc70325c79bccfd3df3d37432f24b97f54 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2921953 Reviewed-by: Dirk Pranke <dpranke@google.com> Commit-Queue: Ari Chivukula <arichiv@chromium.org> Cr-Commit-Position: refs/heads/master@{#887392}
26 lines
959 B
Python
Executable File
26 lines
959 B
Python
Executable File
#!/usr/bin/env python3
|
|
# 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.
|
|
|
|
from schema_util import JsFunctionNameToClassName
|
|
from schema_util import StripNamespace
|
|
import unittest
|
|
|
|
class SchemaUtilTest(unittest.TestCase):
|
|
def testStripNamespace(self):
|
|
self.assertEqual('Bar', StripNamespace('foo.Bar'))
|
|
self.assertEqual('Baz', StripNamespace('Baz'))
|
|
|
|
def testJsFunctionNameToClassName(self):
|
|
self.assertEqual('FooBar', JsFunctionNameToClassName('foo', 'bar'))
|
|
self.assertEqual('FooBar',
|
|
JsFunctionNameToClassName('experimental.foo', 'bar'))
|
|
self.assertEqual('FooBarBaz',
|
|
JsFunctionNameToClassName('foo.bar', 'baz'))
|
|
self.assertEqual('FooBarBaz',
|
|
JsFunctionNameToClassName('experimental.foo.bar', 'baz'))
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|