Esempio n. 1
0
    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)  
Esempio n. 2
0
    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)
Esempio n. 3
0
 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)  
Esempio n. 4
0
 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)