How to use get_future_active_plugins method in Slash

Best Python code snippet using slash

plugin_manager.py

Source:plugin_manager.py Github

copy

Full Screen

...78 return dict(self._iterate_active_plugins())79 def _iterate_active_plugins(self):80 for active_name in self._active:81 yield (active_name, self._get_installed_plugin_instance_by_name(active_name))82 def get_future_active_plugins(self):83 """84 Returns a dictionary of plugins intended to be active once the 'pending activation' mechanism85 is finished86 """87 returned = self.get_active_plugins()88 for name in self._pending_activation:89 returned[name] = self.get_plugin(name)90 for name in self._pending_deactivation:91 returned.pop(name, None)92 return returned93 def get_plugin(self, plugin_name):94 """95 Retrieves a registered plugin by name, or raises a LookupError96 """...

Full Screen

Full Screen

test_cli_environment.py

Source:test_cli_environment.py Github

copy

Full Screen

...86 self._parser.parse_args(args)87 assert caught.exception.code != 088 def test_activation(self):89 cli_utils.add_pending_plugins_from_commandline(["--with-sample-plugin"])90 self.assertIn(self.plugin.get_name(), plugins.manager.get_future_active_plugins(), "plugin was not activated")91 def test_plugins_configuration(self):92 assert isinstance(self.plugin.current_config, ConfigProxy)93 assert isinstance(self.internal_plugin.current_config, ConfigProxy)94 def test_get_plugin(self):95 sample = plugins.manager.get_installed_plugins().get(self.SAMPLE_NAME)96 assert sample is self.plugin97 internal = plugins.manager.get_installed_plugins().get(self.INTERNAL_NAME)98 assert internal is self.internal_plugin99 def test_deactivation(self):100 argv = ["--without-sample-plugin"]101 plugins.manager.activate(self.plugin)102 argv = cli_utils.add_pending_plugins_from_commandline(argv)103 self.assertIn(self.plugin.get_name(), plugins.manager.get_active_plugins())104 assert argv == []105 plugins.manager.activate_pending_plugins()106 self.assertNotIn(self.plugin.get_name(), plugins.manager.get_future_active_plugins())107 self.assertNotIn(self.plugin.get_name(), plugins.manager.get_active_plugins())108 def test_argument_passing(self):109 argv = ["--with-sample-plugin", "--plugin-option", "value"]110 cli_utils.configure_arg_parser_by_plugins(self._parser)111 argv = cli_utils.add_pending_plugins_from_commandline(argv)112 parsed_args = self._parser.parse_args(argv)113 plugins.manager.activate_pending_plugins()114 cli_utils.configure_plugins_from_args(parsed_args)115 self.assertEqual(self.plugin.cmdline_param, "value")116 def test_help_shows_available_plugins(self):117 cli_utils.configure_arg_parser_by_plugins(self._parser)118 with self.assertRaises(SystemExit):119 self._parser.parse_args(['-h'])120 output = self.stdout.getvalue()...

Full Screen

Full Screen

slash_list_plugins.py

Source:slash_list_plugins.py Github

copy

Full Screen

...17 parser = _get_parser()18 parsed_args = parser.parse_args(args.argv)19 _print = Printer(report_stream, force_color=parsed_args.force_color, enable_color=parsed_args.enable_color)20 site.load()21 active = manager.get_future_active_plugins()22 for plugin in sorted(manager.get_installed_plugins(include_internals=False).values(), key=lambda p: p.get_name()):23 name = plugin.get_name()24 normalized_name = manager.normalize_command_line_name(name)25 _print(_title_style(name), end=' ')26 if name in active:27 _print(_enabled_style('active (use --without-{} to deactivate'.format(normalized_name)))28 else:29 _print(_disabled_style('inactive (use --with-{} to activate)'.format(normalized_name)))30 if plugin.__doc__:31 for line in plugin.__doc__.splitlines():32 if line.strip():33 _print('\t', line.strip())...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Slash automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful