MCPcopy Create free account
hub / github.com/Tong89/smartNode / TestCreateEngine

Class TestCreateEngine

tests/test_core.py:67–103  ·  view source on GitHub ↗

工厂函数与引擎基本属性验证。

Source from the content-addressed store, hash-verified

65
66
67class TestCreateEngine:
68 """工厂函数与引擎基本属性验证。"""
69
70 def test_returns_simulation_engine_instance(self):
71 eng = _make_engine()
72 assert isinstance(eng, SimulationEngine)
73
74 def test_autostart_false_not_running(self):
75 eng = _make_engine()
76 assert eng.running is False
77
78 def test_leo_satellites_nonempty(self):
79 eng = _make_engine()
80 assert len(eng.leo_satellites) > 0
81
82 def test_ground_stations_nonempty(self):
83 eng = _make_engine()
84 assert len(eng.ground_stations) > 0
85
86 def test_geo_relays_nonempty(self):
87 eng = _make_engine()
88 assert len(eng.geo_relays) > 0
89
90 def test_seed_reproducibility_ground_stations(self):
91 """相同种子两次创建的引擎,地面站集合应完全相同。"""
92 a = _make_engine(seed=42)
93 b = _make_engine(seed=42)
94 ids_a = [g["id"] for g in a.ground_stations]
95 ids_b = [g["id"] for g in b.ground_stations]
96 assert ids_a == ids_b
97
98 def test_different_seeds_produce_different_configs(self):
99 a = _make_engine(seed=1)
100 b = _make_engine(seed=9999)
101 ids_a = [g["id"] for g in a.ground_stations]
102 ids_b = [g["id"] for g in b.ground_stations]
103 assert ids_a != ids_b
104
105
106# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected