OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 unittest | 5 import unittest |
6 import module | 6 import module |
7 | 7 |
8 try: | 8 try: |
9 import mojom_translator | 9 import mojom_translator |
10 import mojom_files_mojom | 10 from generated import mojom_files_mojom |
11 import mojom_types_mojom | 11 from generated import mojom_types_mojom |
12 bindings_imported = True | 12 bindings_imported = True |
13 except ImportError: | 13 except ImportError: |
14 bindings_imported = False | 14 bindings_imported = False |
15 | 15 |
16 | 16 |
17 @unittest.skipUnless(bindings_imported, 'Could not import python bindings.') | 17 @unittest.skipUnless(bindings_imported, 'Could not import python bindings.') |
18 class TranslateFileGraph(unittest.TestCase): | 18 class TranslateFileGraph(unittest.TestCase): |
19 | 19 |
20 def test_basics(self): | 20 def test_basics(self): |
21 g = mojom_files_mojom.MojomFileGraph() | 21 g = mojom_files_mojom.MojomFileGraph() |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 result2 = t.KindFromMojom(mojom_type) | 686 result2 = t.KindFromMojom(mojom_type) |
687 self.assertIs(result, result2) | 687 self.assertIs(result, result2) |
688 | 688 |
689 # Nullable type reference | 689 # Nullable type reference |
690 mojom_type.type_reference.nullable = True | 690 mojom_type.type_reference.nullable = True |
691 nullable_result = t.KindFromMojom(mojom_type) | 691 nullable_result = t.KindFromMojom(mojom_type) |
692 self.assertTrue(module.IsNullableKind(nullable_result)) | 692 self.assertTrue(module.IsNullableKind(nullable_result)) |
693 | 693 |
694 if __name__ == '__main__': | 694 if __name__ == '__main__': |
695 unittest.main() | 695 unittest.main() |
OLD | NEW |