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

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

Issue 517353002: mojo: Starting generator for python bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove not-to-commit 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_constants_unittest.py
diff --git a/mojo/python/tests/bindings_constants_unittest.py b/mojo/python/tests/bindings_constants_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..2b8aceeb526f3616ef7965996dc8885b24fade1a
--- /dev/null
+++ b/mojo/python/tests/bindings_constants_unittest.py
@@ -0,0 +1,28 @@
+# Copyright 2014 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.
+
+import math
+import unittest
+
+# Generated files
+# pylint: disable=F0401
+import sample_service_mojom
+
+
+class ConstantBindingsTest(unittest.TestCase):
+
+ def test_constant_generation(self):
+ self.assertEquals(sample_service_mojom.TWELVE, 12)
+ self.assertEquals(sample_service_mojom.TOO_BIG_FOR_SIGNED_INT64,
+ 9999999999999999999)
+ self.assertEquals(sample_service_mojom.DOUBLE_INFINITY,
+ float('inf'))
+ self.assertEquals(sample_service_mojom.DOUBLE_NEGATIVE_INFINITY,
+ float('-inf'))
+ self.assertTrue(math.isnan(sample_service_mojom.DOUBLE_NA_N))
+ self.assertEquals(sample_service_mojom.FLOAT_INFINITY,
+ float('inf'))
+ self.assertEquals(sample_service_mojom.FLOAT_NEGATIVE_INFINITY,
+ float('-inf'))
+ self.assertTrue(math.isnan(sample_service_mojom.FLOAT_NA_N))
« no previous file with comments | « mojo/public/tools/bindings/mojom_bindings_generator.py ('k') | mojo/tools/run_mojo_python_bindings_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698