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