"""Unit tests for the logic layer.""" from logic import label_participant import pytest @pytest.fixture def label_participant_id(): """Mock label participant ID.""" return 1 def test_merge_lp_nodes(mocker, label_participant_id): """Assert logic calls model successfully.""" mock_merge_lp_nodes = mocker.patch( 'model.label_participant.merge_lp_nodes', return_value=label_participant_id ) result = label_participant.merge_lp_nodes( master_node_uuid=1, child_node_uuids=2) assert label_participant_id == result mock_merge_lp_nodes.assert_called_with(1, 2) def test_merge_lp_nodes_fail(): """Assert TypeError when one of param is missing.""" with pytest.raises(TypeError): label_participant.merge_lp_nodes(master_node_uuid=1)