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

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

Issue 622593002: mojo: Allow circular dependencies between structs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_python_generator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import math 5 import math
6 import unittest 6 import unittest
7 7
8 # pylint: disable=F0401 8 # pylint: disable=F0401
9 import mojo.system 9 import mojo.system
10 10
11 # Generated files 11 # Generated files
12 # pylint: disable=F0401 12 # pylint: disable=F0401
13 import regression_tests_mojom
13 import sample_import_mojom 14 import sample_import_mojom
14 import sample_import2_mojom 15 import sample_import2_mojom
15 import sample_service_mojom 16 import sample_service_mojom
16 17
17 18
18 class StructBindingsTest(unittest.TestCase): 19 class StructBindingsTest(unittest.TestCase):
19 20
20 def testModule(self): 21 def testModule(self):
21 self.assertEquals(sample_service_mojom.DefaultsTest.__module__, 22 self.assertEquals(sample_service_mojom.DefaultsTest.__module__,
22 'sample_service_mojom') 23 'sample_service_mojom')
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 p = sample_import_mojom.Point(34, y=12) 200 p = sample_import_mojom.Point(34, y=12)
200 self.assertEquals(p.x, 34) 201 self.assertEquals(p.x, 34)
201 self.assertEquals(p.y, 12) 202 self.assertEquals(p.y, 12)
202 203
203 with self.assertRaises(TypeError): 204 with self.assertRaises(TypeError):
204 p = sample_import_mojom.Point(0, 0, 0) 205 p = sample_import_mojom.Point(0, 0, 0)
205 with self.assertRaises(TypeError): 206 with self.assertRaises(TypeError):
206 p = sample_import_mojom.Point(0, x=0) 207 p = sample_import_mojom.Point(0, x=0)
207 with self.assertRaises(TypeError): 208 with self.assertRaises(TypeError):
208 p = sample_import_mojom.Point(c=0) 209 p = sample_import_mojom.Point(c=0)
210
211 def testCyclicDefinition(self):
212 a = regression_tests_mojom.A()
213 b = regression_tests_mojom.B()
214 self.assertIsNone(a.b)
215 self.assertIsNone(b.a)
216 a.b = b
217 self.assertIs(a.b, b)
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_python_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698