def setUp(self): """ Get the text from --help-reactors """ self.options = app.ReactorSelectionMixin() self.options.messageOutput = StringIO() self.assertRaises(SystemExit, self.options.opt_help_reactors) self.message = self.options.messageOutput.getvalue()
def test_onlySupportedReactors(self): """ --help-reactors with only supported reactors """ def getReactorTypes(): yield twisted_reactors.default options = app.ReactorSelectionMixin() options._getReactorTypes = getReactorTypes options.messageOutput = StringIO() self.assertRaises(SystemExit, options.opt_help_reactors) message = options.messageOutput.getvalue() self.assertNotIn("reactors not available", message)