bigchaindb/tests/test_processes.py
Sylvain Bellemare 79997848cd Refine test for the election pipeline process
test that the process is started with the events_queue kwargs
2017-04-11 17:24:21 +02:00

25 lines
812 B
Python

from unittest.mock import patch
from multiprocessing import Process
from bigchaindb.pipelines import vote, block, election, stale
@patch.object(stale, 'start')
@patch.object(election, 'start')
@patch.object(block, 'start')
@patch.object(vote, 'start')
@patch.object(Process, 'start')
@patch('bigchaindb.events.setup_events_queue', spec_set=True, autospec=True)
def test_processes_start(mock_setup_events_queue, mock_process, mock_vote,
mock_block, mock_election, mock_stale):
from bigchaindb import processes
processes.start()
mock_vote.assert_called_with()
mock_block.assert_called_with()
mock_stale.assert_called_with()
mock_process.assert_called_with()
mock_election.assert_called_once_with(
events_queue=mock_setup_events_queue.return_value)