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