Spaces:
No application file
No application file
File size: 1,232 Bytes
9529bc2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
"""
Tests for core functionality.
"""
import pytest
from core.robot_design import RobotDesign
from core.orchestrator import Orchestrator
def test_robot_design_creation():
"""Test creating a robot design."""
design = RobotDesign(
type="robot",
components=["body", "wheels"],
specifications={
"body": {"size": "medium"},
"wheels": {"count": 4}
}
)
assert design.type == "robot"
assert "body" in design.components
assert design.specifications["wheels"]["count"] == 4
def test_orchestrator_initialization(mock_physics_engine):
"""Test orchestrator initialization."""
orchestrator = Orchestrator(physics_engine=mock_physics_engine)
assert orchestrator.physics_engine == mock_physics_engine
assert not mock_physics_engine.initialized
def test_orchestrator_simulation(mock_physics_engine, mock_llm_response):
"""Test orchestrator simulation workflow."""
orchestrator = Orchestrator(physics_engine=mock_physics_engine)
design = RobotDesign(**mock_llm_response["design"])
result = orchestrator.simulate_design(design)
assert result["success"]
assert "metrics" in result
assert "distance" in result["metrics"] |