]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / command_script / import / rdar-12586188 / TestRdar12586188.py
1 """Check that we handle an ImportError in a special way when command script importing files."""
2
3 from __future__ import print_function
4
5
6 import os
7 import sys
8 import time
9 import lldb
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
13
14
15 class Rdar12586188TestCase(TestBase):
16
17     mydir = TestBase.compute_mydir(__file__)
18
19     @add_test_categories(['pyapi'])
20     @no_debug_info_test
21     def test_rdar12586188_command(self):
22         """Check that we handle an ImportError in a special way when command script importing files."""
23         self.run_test()
24
25     def setUp(self):
26         # Call super's setUp().
27         TestBase.setUp(self)
28
29     def run_test(self):
30         """Check that we handle an ImportError in a special way when command script importing files."""
31
32         self.expect(
33             "command script import ./fail12586188.py --allow-reload",
34             error=True,
35             substrs=['raise ImportError("I do not want to be imported")'])
36         self.expect(
37             "command script import ./fail212586188.py --allow-reload",
38             error=True,
39             substrs=['raise ValueError("I do not want to be imported")'])