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

Unified Diff: mojo/python/tests/bindings_enums_unittest.py

Issue 538613005: mojo: Start generating structs for python bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + fix constant array Created 6 years, 3 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: mojo/python/tests/bindings_enums_unittest.py
diff --git a/mojo/python/tests/bindings_enums_unittest.py b/mojo/python/tests/bindings_enums_unittest.py
index bcf21f0a06eb9530e4faf13013fdd5d034af1668..08163ab7bcc611afd9feeb3ef5fb2cbef04150a3 100644
--- a/mojo/python/tests/bindings_enums_unittest.py
+++ b/mojo/python/tests/bindings_enums_unittest.py
@@ -7,6 +7,7 @@ import unittest
# Generated files
# pylint: disable=F0401
import sample_import_mojom
+import sample_service_mojom
class EnumBindingsTest(unittest.TestCase):
@@ -27,6 +28,13 @@ class EnumBindingsTest(unittest.TestCase):
self.assertEquals(sample_import_mojom.YetAnotherShape.CIRCLE, 21)
self.assertEquals(sample_import_mojom.YetAnotherShape.TRIANGLE, 22)
+ # Testing that internal enum class have expected constant values.
+ def testInternalEnumGeneration(self):
+ self.assertEquals(sample_service_mojom.Bar.Type.VERTICAL, 1)
+ self.assertEquals(sample_service_mojom.Bar.Type.HORIZONTAL, 2)
+ self.assertEquals(sample_service_mojom.Bar.Type.BOTH, 3)
+ self.assertEquals(sample_service_mojom.Bar.Type.INVALID, 4)
+
# Testing an enum class cannot be instantiated.
def testNonInstantiableEnum(self):
with self.assertRaises(TypeError):

Powered by Google App Engine
This is Rietveld 408576698