Ejemplo n.º 1
0
 def test_should_display_one_plugins(self):
     with redirect_stdout(io.StringIO()) as temp_stdout:
         plugins_command.dump_plugins(self.parser.parse_args(['plugins']))
         stdout = temp_stdout.getvalue()
     self.assertIn('plugins = [<class ', stdout)
     self.assertIn('test-plugin-cli', stdout)
     self.assertIn('test_plugins_command.PluginOperator', stdout)
Ejemplo n.º 2
0
    def test_should_display_no_plugins(self):
        with redirect_stdout(io.StringIO()) as temp_stdout:
            plugins_command.dump_plugins(self.parser.parse_args(['plugins']))
            stdout = temp_stdout.getvalue()

        self.assertIn('plugins = []', stdout)
        self.assertIn('No plugins loaded', stdout)
        self.assertIn("PLUGINS MANGER:", stdout)
        self.assertIn("PLUGINS:", stdout)
Ejemplo n.º 3
0
 def test_should_display_one_plugins(self):
     with redirect_stdout(io.StringIO()) as temp_stdout:
         plugins_command.dump_plugins(self.parser.parse_args(['plugins']))
         stdout = temp_stdout.getvalue()
     print(stdout)
     self.assertIn('Plugins directory:', stdout)
     self.assertIn("Loaded plugins: 1", stdout)
     self.assertIn('test-plugin-cli', stdout)
     self.assertIn('PluginHook', stdout)
Ejemplo n.º 4
0
 def test_should_display_one_plugins(self):
     with redirect_stdout(io.StringIO()) as temp_stdout:
         plugins_command.dump_plugins(
             self.parser.parse_args(['plugins', '--output=json']))
         stdout = temp_stdout.getvalue()
     info = json.loads(stdout)
     assert info == [{
         'name': TestPlugin.name,
         'source': None,
         'hooks': [PluginHook.__name__],
         'executors': [],
         'macros': [],
         'flask_blueprints': [],
         'appbuilder_views': [],
         'appbuilder_menu_items': [],
         'global_operator_extra_links': [],
         'operator_extra_links': [],
     }]
Ejemplo n.º 5
0
 def test_should_display_no_plugins(self):
     with redirect_stdout(io.StringIO()) as temp_stdout:
         plugins_command.dump_plugins(self.parser.parse_args(['plugins', '--output=json']))
         stdout = temp_stdout.getvalue()
     assert 'No plugins loaded' in stdout