def _test_start_and_stop(self, plugin_manager, expected):

        # Make sure the plugin manager found only the required plugins.
        self.assertEqual(
            list(sorted(expected)),
            list(sorted(plugin.id for plugin in plugin_manager))
        )

        # Start the plugin manager. This starts all of the plugin manager's
        # plugins.
        plugin_manager.start()

        # Make sure all of the the plugins were started.
        for id in expected:
            plugin = plugin_manager.get_plugin(id)
            self.assertNotEqual(None, plugin)
            self.assertEqual(True, plugin.started)

        # Stop the plugin manager. This stops all of the plugin manager's
        # plugins.
        plugin_manager.stop()

        # Make sure all of the the plugins were stopped.
        for id in expected:
            plugin = plugin_manager.get_plugin(id)
            self.assertNotEqual(None, plugin)
            self.assertEqual(True, plugin.stopped)

        return


# Entry point for stand-alone testing.
Make sure the plugin manager starts and stops the expected plugins.
dataset/ETHPy150Open enthought/envisage/envisage/tests/package_plugin_manager_test_case.py/PackagePluginManagerTestCase._test_start_and_stop