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..3f1f6c30823fc67b8443678ea2ae89fd1f843530 |
--- /dev/null |
+++ b/mojo/python/tests/bindings_constants_unittest.py |
@@ -0,0 +1,27 @@ |
+# 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 |
+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)) |
pkl (ping after 24h if needed)
2014/09/01 12:52:02
Shouldn't DOUBLE_NA_N be DOUBLE_NAN instead?
qsr
2014/09/01 14:19:38
The issue is that the object is name NaN in the id
|
+ 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)) |