def test__publisher(self): mock_publish = mock.MagicMock() mock_is_published = mock.MagicMock() queue = collections.deque() broker._publisher(mock_publish, queue, mock_is_published) mock_publish.assert_called_once_with(queue) mock_is_published.set.assert_called_once_with()
def test__publisher_fails(self): mock_publish = mock.MagicMock(side_effect=Exception()) mock_is_published = mock.MagicMock() queue = collections.deque() broker._publisher(mock_publish, queue, mock_is_published) mock_is_published.set.assert_called_once_with()
def test__publisher_fails(self): mock_publish = mock.MagicMock(side_effect=Exception()) queue = collections.deque() broker._publisher(mock_publish, queue)