test(demo): add unit and integration coverage for pipeline

Introduce focused unit, integration, and NATS-path tests for demo modules, and align assertions with final schema and temporal contracts (window int, seq=30, fill-level ratio). This commit isolates validation logic from runtime changes and provides reproducible QA for pipeline behavior and failure modes.
This commit is contained in:
2026-02-27 09:59:14 +08:00
parent b24644f16e
commit d6fd6c03e6
8 changed files with 1669 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
"""Test fixtures for demo package."""
import numpy as np
import pytest
import torch
@pytest.fixture
def mock_frame_tensor():
"""Return a mock video frame tensor (C, H, W)."""
return torch.randn(3, 224, 224)
@pytest.fixture
def mock_frame_array():
"""Return a mock video frame as numpy array (H, W, C)."""
return np.random.randn(224, 224, 3).astype(np.float32)
@pytest.fixture
def mock_video_sequence():
"""Return a mock video sequence tensor (T, C, H, W)."""
return torch.randn(16, 3, 224, 224)