Assert the parser fails with the expected message. Caller must ensure that self.parser is an InterceptingOptionParser.
(self, cmdline_args, expected_output)
| 137 | # -- Assertions used in more than one class -------------------- |
| 138 | |
| 139 | def assertParseFail(self, cmdline_args, expected_output): |
| 140 | """ |
| 141 | Assert the parser fails with the expected message. Caller |
| 142 | must ensure that self.parser is an InterceptingOptionParser. |
| 143 | """ |
| 144 | try: |
| 145 | self.parser.parse_args(cmdline_args) |
| 146 | except InterceptedError as err: |
| 147 | self.assertEqual(err.error_message, expected_output) |
| 148 | else: |
| 149 | self.assertFalse("expected parse failure") |
| 150 | |
| 151 | def assertOutput(self, |
| 152 | cmdline_args, |
no test coverage detected