def test_run_message(self): """Display a message to stdout when run is not set properly""" sys.stderr = MockSys() sys.stdout = MockSys() plugin = Plugin(name="my_plugin",action="store_true", description="my help menu") plugin.run(value=None) actual = sys.stdout.captured() expected = """ If you see this text, it means you are *not* using the "run()" method in your plugin code. You should be defining such a method to be executed when your plugin is called. """ self.assertEqual(actual, expected)
def test_run_message(self): """Display a message to stdout when run is not set properly""" sys.stderr = MockSys() sys.stdout = MockSys() plugin = Plugin(name="my_plugin", action="store_true", description="my help menu") plugin.run(value=None) actual = sys.stdout.captured() expected = """ If you see this text, it means you are *not* using the "run()" method in your plugin code. You should be defining such a method to be executed when your plugin is called. """ self.assertEqual(actual, expected)
def test_run_none(self): """Nothing should happen when run is called""" sys.stderr = MockSys() sys.stdout = MockSys() plugin = Plugin(name="my_plugin",action="store_true", description="my help menu") actual = plugin.run(value=None) expected = None self.assertEqual(actual, expected)
def test_run_none(self): """Nothing should happen when run is called""" sys.stderr = MockSys() sys.stdout = MockSys() plugin = Plugin(name="my_plugin", action="store_true", description="my help menu") actual = plugin.run(value=None) expected = None self.assertEqual(actual, expected)