def test_find_profiler_not_found(self, mock_plugins): type_id = '2344' mock_plugins.get_profiler_by_type.side_effect = plugin_exceptions.PluginNotFound() # test manager plugin, cfg = AgentManager._profiler(type_id) # validation mock_plugins.get_profiler_by_type.assert_called_with(type_id) self.assertTrue(isinstance(plugin, Profiler)) self.assertEqual(cfg, {})
def test_find_profiler(self, mock_plugins): type_id = '2344' plugin = Mock() mock_plugins.get_profiler_by_type.return_value = (plugin, {}) # test manager _plugin, cfg = AgentManager._profiler(type_id) # validation mock_plugins.get_profiler_by_type.assert_called_with(type_id) self.assertEqual(plugin, _plugin) self.assertEqual(cfg, {})