コード例 #1
0
ファイル: test_agent_manager.py プロジェクト: signull/pulp
    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, {})
コード例 #2
0
    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, {})
コード例 #3
0
ファイル: test_agent_manager.py プロジェクト: signull/pulp
    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, {})
コード例 #4
0
    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, {})