33 lines
836 B
Python
33 lines
836 B
Python
"""
|
|
conftest.py - Common fixtures for pytrace tests.
|
|
"""
|
|
import pytest
|
|
from unittest.mock import MagicMock
|
|
|
|
# Mock objects for NodeIO and TraceContext for isolated testing
|
|
@pytest.fixture
|
|
def mock_io():
|
|
"""Provides a mock NodeIO instance."""
|
|
io = MagicMock()
|
|
# Configure common methods
|
|
io.get_input.return_value = None
|
|
io.get_param.return_value = None
|
|
io.set_output.return_value = None
|
|
io.get_collected_outputs.return_value = {}
|
|
return io
|
|
|
|
@pytest.fixture
|
|
def mock_context():
|
|
"""Provides a mock TraceContext instance."""
|
|
context = MagicMock()
|
|
# Configure common methods
|
|
context.log.return_value = None
|
|
return context
|
|
|
|
@pytest.fixture
|
|
def mock_comms_interface():
|
|
"""Provides a mock CommsInterface."""
|
|
comms = MagicMock()
|
|
comms.emit_log.return_value = None
|
|
return comms
|