1""" 2Test the PExpectTest test functions. 3""" 4 5from lldbsuite.test.lldbpexpect import * 6 7 8class TestPExpectTestCase(PExpectTest): 9 NO_DEBUG_INFO_TESTCASE = True 10 11 def assert_expect_fails_with(self, cmd, expect_args, expected_msg): 12 try: 13 self.expect(cmd, **expect_args) 14 except AssertionError as e: 15 self.assertIn(expected_msg, str(e)) 16 else: 17 self.fail("expect should have raised AssertionError!") 18 19 def test_expect(self): 20 # Test that passing a string to the 'substrs' argument is rejected. 21 self.assert_expect_fails_with( 22 "settings list prompt", 23 dict(substrs="some substring"), 24 "substrs must be a collection of strings", 25 ) 26