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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 years, 10 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: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py b/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py
similarity index 53%
copy from third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py
copy to third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py
index 821a721b64769294520d104af98bcbbc00388599..a6847737190b793a76a1fb25ac592982ff6fab53 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py
@@ -21,17 +21,17 @@ try:
imp.find_module("mojom")
except ImportError:
sys.path.append(os.path.join(_GetDirAbove("pylib"), "pylib"))
-from mojom.generate import module as mojom
+from mojom.generate import generator
-class ModuleTest(unittest.TestCase):
+class StringManipulationTest(unittest.TestCase):
+ """generator contains some string utilities, this tests only those."""
+
+ def testUnderToCamel(self):
+ """Tests UnderToCamel which converts underscore_separated to CamelCase."""
+ self.assertEquals("CamelCase", generator.UnderToCamel("camel_case"))
+ self.assertEquals("CamelCase", generator.UnderToCamel("CAMEL_CASE"))
+
+if __name__ == "__main__":
+ unittest.main()
- def testNonInterfaceAsInterfaceRequest(self):
- """Tests that a non-interface cannot be used for interface requests."""
- module = mojom.Module('test_module', 'test_namespace')
- struct = mojom.Struct('TestStruct', module=module)
- with self.assertRaises(Exception) as e:
- mojom.InterfaceRequest(struct)
- self.assertEquals(
- e.exception.__str__(),
- 'Interface request requires \'x:TestStruct\' to be an interface.')

Powered by Google App Engine
This is Rietveld 408576698