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

Side by Side Diff: mojo/python/tests/bindings_constants_unittest.py

Issue 675563002: Remove mojo/python and gyp targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/python/tests/async_wait_unittest.py ('k') | mojo/python/tests/bindings_enums_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import math
6 import unittest
7
8 # Generated files
9 # pylint: disable=F0401
10 import sample_service_mojom
11
12
13 class ConstantBindingsTest(unittest.TestCase):
14
15 def testConstantGeneration(self):
16 self.assertEquals(sample_service_mojom.TWELVE, 12)
17 self.assertEquals(sample_service_mojom.TOO_BIG_FOR_SIGNED_INT64,
18 9999999999999999999)
19 self.assertEquals(sample_service_mojom.DOUBLE_INFINITY,
20 float('inf'))
21 self.assertEquals(sample_service_mojom.DOUBLE_NEGATIVE_INFINITY,
22 float('-inf'))
23 self.assertTrue(math.isnan(sample_service_mojom.DOUBLE_NA_N))
24 self.assertEquals(sample_service_mojom.FLOAT_INFINITY,
25 float('inf'))
26 self.assertEquals(sample_service_mojom.FLOAT_NEGATIVE_INFINITY,
27 float('-inf'))
28 self.assertTrue(math.isnan(sample_service_mojom.FLOAT_NA_N))
29
30 def testConstantOnStructGeneration(self):
31 self.assertEquals(sample_service_mojom.Foo.FOOBY, "Fooby")
32
33 def testStructImmutability(self):
34 with self.assertRaises(AttributeError):
35 sample_service_mojom.Foo.FOOBY = 0
36 with self.assertRaises(AttributeError):
37 del sample_service_mojom.Foo.FOOBY
38 with self.assertRaises(AttributeError):
39 sample_service_mojom.Foo.BAR = 1
OLDNEW
« no previous file with comments | « mojo/python/tests/async_wait_unittest.py ('k') | mojo/python/tests/bindings_enums_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698