"""Test event handling..""" from unittest.mock import patch from src.logic import event_handling @patch('src.logic.event_handling.format_artists') @patch('src.logic.event_handling.release_correction') @patch('src.logic.event_handling.update_product') def test_processing_logic_success(mock_update_product, mock_correction, mock_format): """Test processing logic success.""" mock_correction.get_release_correction_updates.return_value = ( {'foo': 'bar'}, {} ) mock_format.format_artists.return_value = None assert event_handling.processing_logic(123, 1) is None mock_update_product.call_update_endpoint.assert_called_once_with(123, {'foo': 'bar'}) @patch('src.logic.event_handling.format_artists') @patch('src.logic.event_handling.release_correction') @patch('src.logic.event_handling.update_product') def test_processing_logic_success_with_artists(mock_update_product, mock_correction, mock_format): """Test processing logic success.""" mock_correction.get_release_correction_updates.return_value = ( {'foo': 'bar'}, {} ) mock_format.format_artists.return_value = [{'role': 'foo', 'name': 'bar'}] assert event_handling.processing_logic(123, 1) is None mock_update_product.call_update_endpoint.assert_called_once_with( 123, {'foo': 'bar', 'product_artists': [{'role': 'foo', 'name': 'bar'}]}, )