STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_burn_time_sync.py
Go to the documentation of this file.
1"""Tests for burn time field synchronization."""
2
3from types import SimpleNamespace
4
5from engine.pipeline.burn_time_sync import canonical_burn_time_s, sync_burn_time_fields
6
7
9 config = SimpleNamespace(
10 design_requirements=SimpleNamespace(target_burn_time=6.8),
11 thrust=SimpleNamespace(burn_time=10.0),
12 pressure_curves=SimpleNamespace(target_burn_time_s=6.0),
13 )
14 assert canonical_burn_time_s(config) == 6.8
15
16
18 config = SimpleNamespace(
19 design_requirements=SimpleNamespace(target_burn_time=7.5),
20 thrust=SimpleNamespace(burn_time=10.0),
21 pressure_curves=SimpleNamespace(target_burn_time_s=6.0),
22 )
23 sync_burn_time_fields(config)
24 assert config.thrust.burn_time == 7.5
25 assert config.pressure_curves.target_burn_time_s == 7.5
26 assert config.design_requirements.target_burn_time == 7.5