Ejemplo n.º 1
0
    def test_check_allowed_origins_no_match(self, mock_task, mock_config, mock_create):
        mock_task.return_value = None
        mock_config.return_value = 'foo'

        mock_queue = mock.MagicMock()
        obj = SnollaWorker(self.cfg, None, mock_queue)
        obj.handle_extracted_action('action', 1, 'the commit')

        mock_task.assert_called_once_with('action', mock_config.return_value)
        mock_config.assert_called_once_with(self.cfg)
        self.assertFalse(mock_queue.called)
        self.assertFalse(mock_create.called)
Ejemplo n.º 2
0
    def test_check_allowed_origins_match(self, mock_task, mock_config, mock_create):
        mock_task.return_value = 'afinetask'
        mock_config.return_value = 'foo'
        mock_create.return_value = 'the bugzilla task'

        mock_queue = mock.MagicMock()
        obj = SnollaWorker(self.cfg, None, mock_queue)
        obj.handle_extracted_action('action', 1, 'the commit')

        mock_task.assert_called_once_with('action', mock_config.return_value)
        mock_config.assert_called_once_with(self.cfg)
        mock_create.assert_called_once_with('afinetask', 1, 'the commit')
        mock_queue.put.assert_called_once_with('the bugzilla task')