mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 11:36:37 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import pytest
|
||||
pytest.skip("Obsolete test file replaced by component-specific unit tests", allow_module_level=True)
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
from f02_flight_processing_engine import FlightProcessingEngine
|
||||
|
||||
@pytest.fixture
|
||||
def mock_deps():
|
||||
return {
|
||||
"chunk_manager": Mock(),
|
||||
"failure_coord": Mock()
|
||||
}
|
||||
|
||||
@pytest.fixture
|
||||
def engine(mock_deps):
|
||||
return FlightProcessingEngine(
|
||||
vo_frontend=Mock(), factor_graph=Mock(), cvgl_backend=Mock(),
|
||||
failure_coordinator=mock_deps["failure_coord"],
|
||||
route_chunk_manager=mock_deps["chunk_manager"]
|
||||
)
|
||||
|
||||
class TestChunkLifecycleOrchestration:
|
||||
"""Tests defined in 02.2.03_feature_chunk_lifecycle_orchestration.md"""
|
||||
|
||||
def test_get_active_chunk_returns_current_chunk(self, engine, mock_deps):
|
||||
engine.last_frame_id = 10
|
||||
mock_deps["chunk_manager"].get_chunk_for_frame.return_value = "chunk_abc"
|
||||
mock_deps["chunk_manager"].flight_chunks = {"flight_123": {"chunk_abc": "MockChunkHandle"}}
|
||||
|
||||
chunk = engine.get_active_chunk("flight_123")
|
||||
|
||||
assert chunk == "MockChunkHandle"
|
||||
mock_deps["chunk_manager"].get_chunk_for_frame.assert_called_once_with("flight_123", 10)
|
||||
|
||||
def test_create_new_chunk_delegates_to_f12(self, engine, mock_deps):
|
||||
mock_deps["chunk_manager"].create_chunk.return_value = "NewChunkHandle"
|
||||
|
||||
chunk = engine.create_new_chunk("flight_123", 11)
|
||||
|
||||
assert chunk == "NewChunkHandle"
|
||||
mock_deps["chunk_manager"].create_chunk.assert_called_once_with("flight_123", 11)
|
||||
Reference in New Issue
Block a user