Skip to content

Commit 6ee0a71

Browse files
committed
cleanup tests
1 parent 063159c commit 6ee0a71

12 files changed

Lines changed: 6 additions & 139 deletions

arena_simulation_setup/tests/unit/test_geometry.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,6 @@ def test_pose_parse_invalid():
264264
Pose.parse("bad")
265265

266266

267-
def test_pose_defaults():
268-
p = Pose()
269-
assert (p.position.x, p.position.y, p.position.z) == pytest.approx((0, 0, 0))
270-
assert p.orientation.w == pytest.approx(1.0)
271-
272-
273267
def test_pose_to_2d():
274268
p = Pose.parse([3.0, 4.0, 0.5])
275269
x, y, yaw = p.to_2d()
@@ -305,11 +299,6 @@ def test_positionradius_iter():
305299
# ---------------------------------------------------------------------------
306300

307301

308-
def test_scale_defaults():
309-
s = Scale()
310-
assert (s.x, s.y, s.z) == pytest.approx((1.0, 1.0, 1.0))
311-
312-
313302
def test_scale_parse_3d():
314303
s = Scale.parse([2.0, 3.0, 4.0])
315304
assert (s.x, s.y, s.z) == pytest.approx((2.0, 3.0, 4.0))

arena_simulation_setup/tests/unit/test_shared_entities.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from __future__ import annotations
22

3-
import warnings
4-
5-
import attrs
63
import pytest
74

85
from arena_simulation_setup.shared.entities import (
@@ -13,8 +10,7 @@
1310
Obstacle,
1411
)
1512
from arena_simulation_setup.tree.assets.Object import ObjectIdentifier
16-
from arena_simulation_setup.utils.geometry import Pose, Position, Scale
17-
from arena_simulation_setup.utils.models import ModelWrapper
13+
from arena_simulation_setup.utils.geometry import Pose, Scale
1814

1915

2016
def _model_id():
@@ -121,11 +117,6 @@ def test_entity_asdict_expand_extra_false():
121117
# ---------------------------------------------------------------------------
122118

123119

124-
def test_obstacle_scale_none_by_default():
125-
obs = _make_obstacle()
126-
assert obs.scale is None
127-
128-
129120
def test_obstacle_scale_set():
130121
obs = _make_obstacle()
131122
obs.scale = Scale(2.0, 2.0, 2.0)
@@ -195,7 +186,6 @@ def test_custom_dynamic_obstacle_getattr_miss():
195186

196187

197188
def test_custom_dynamic_obstacle_parse_emits_future_warning():
198-
from arena_simulation_setup.tree.assets.Pedestrian import PedestrianIdentifier
199189
data = {
200190
"name": "cdo",
201191
"pose": [0.0, 0.0],

arena_simulation_setup/tests/unit/test_shared_world.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ def _elev_pos() -> Position:
1313
return Position(0.0, 0.0, 0.0)
1414

1515

16-
def test_elevator_default_size():
17-
e = Elevator(name="elev", position=_elev_pos())
18-
assert e.size == pytest.approx([2.0, 2.0, 2.5])
19-
20-
21-
def test_elevator_default_door_side():
22-
e = Elevator(name="elev", position=_elev_pos())
23-
assert e.door_side == '+x'
24-
25-
26-
def test_elevator_default_timings():
27-
e = Elevator(name="elev", position=_elev_pos())
28-
assert e.transition_time == pytest.approx(1.0)
29-
assert e.hold_time == pytest.approx(2.0)
30-
assert e.travel_time == pytest.approx(3.0)
31-
32-
3316
def test_elevator_material_converter():
3417
from arena_simulation_setup.tree.assets.Material import MaterialIdentifier
3518
e = Elevator(name="elev", position=_elev_pos())
@@ -126,29 +109,11 @@ def test_door_activation_distance_tuple():
126109
assert d.activation_distance == (1.5, 0.0)
127110

128111

129-
def test_door_default_kind_and_timings():
130-
d = Door(
131-
name="door",
132-
start=Position(0.0, 0.0, 0.0),
133-
end=Position(1.0, 0.0, 0.0),
134-
)
135-
assert d.kind == 'sliding'
136-
assert d.transition_time == pytest.approx(1.0)
137-
assert d.hold_time == pytest.approx(2.0)
138-
assert d.activation_distance == (3.0, 3.0)
139-
140-
141112
# ---------------------------------------------------------------------------
142113
# Floor
143114
# ---------------------------------------------------------------------------
144115

145116

146-
def test_floor_default_lengths():
147-
f = Floor(name="floor", pos=Position(0.0, 0.0, 0.0))
148-
assert f.x_length == pytest.approx(20.0)
149-
assert f.y_length == pytest.approx(20.0)
150-
151-
152117
def test_floor_position_converter():
153118
f = Floor(name="floor", pos=Position(5.0, 6.0, 0.0))
154119
assert f.pos.x == pytest.approx(5.0)

arena_simulation_setup/tests/unit/test_tree_scenario.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import os
43
import warnings
54

65
import pytest
@@ -50,13 +49,6 @@ def test_robot_goal_parse_empty_parse_fallback():
5049
# ---------------------------------------------------------------------------
5150

5251

53-
def test_scenario_empty_construction():
54-
s = Scenario()
55-
assert s.static == []
56-
assert s.dynamic == []
57-
assert s.robots == []
58-
59-
6052
def test_scenario_with_robots():
6153
rg = RobotGoal.parse({"start": [0.0, 0.0], "goal": [1.0, 1.0]})
6254
s = Scenario(robots=[rg])

arena_simulation_setup/tests/unit/test_utils_generative.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ def test_barn_registered():
4141
# ---------------------------------------------------------------------------
4242

4343

44-
def test_base_configuration_defaults():
45-
cfg = BaseConfiguration()
46-
assert cfg.width == pytest.approx(15.0)
47-
assert cfg.height == pytest.approx(15.0)
48-
assert cfg.resolution == pytest.approx(0.05)
49-
assert cfg.wall_gap == pytest.approx(0.05)
50-
51-
5244
def test_base_configuration_custom_values():
5345
cfg = BaseConfiguration(width=20.0, height=30.0)
5446
assert cfg.width == pytest.approx(20.0)
@@ -91,13 +83,6 @@ def test_world_generator_empty_compute_has_walls():
9183
# ---------------------------------------------------------------------------
9284

9385

94-
def test_hallway_config_defaults():
95-
cfg = WorldGeneratorHallway.Configuration()
96-
assert cfg.width == pytest.approx(80.0)
97-
assert cfg.height == pytest.approx(50.0)
98-
assert cfg.hallway_height == pytest.approx(5.0)
99-
100-
10186
def test_hallway_config_hallway_top():
10287
cfg = WorldGeneratorHallway.Configuration()
10388
assert cfg.hallway_top == pytest.approx(cfg.height / 2 + cfg.hallway_height / 2)
@@ -225,12 +210,8 @@ def test_to_walls_multilinestring():
225210
# ---------------------------------------------------------------------------
226211

227212

228-
def test_barn_config_defaults():
213+
def test_barn_config_pitch_derived():
229214
cfg = WorldGeneratorBarn.Configuration()
230-
assert cfg.width == pytest.approx(10.0)
231-
assert cfg.height == pytest.approx(10.0)
232-
assert cfg.box_size == pytest.approx(0.4)
233-
assert cfg.passage_width == pytest.approx(1.0)
234215
# one box row separates parallel lane strands
235216
assert cfg.pitch == pytest.approx(cfg.passage_width + cfg.box_size + cfg.box_gap)
236217

task_generator/tests/ros/test_adapters_registry.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,3 @@ def test_displays_list_coerces_to_tuple(self):
123123
)
124124
assert isinstance(meta.displays, tuple)
125125
assert meta.displays == (hint,)
126-
127-
def test_displays_default_is_empty_tuple(self):
128-
from arena_robots.bringup.mobile.nav2 import Nav2Bringup
129-
from arena_robots.clients.goto_pose import GotoPoseClient
130-
from arena_robots.task_kinds import TaskKind
131-
from task_generator.tasks.robots.adapters import AdapterMeta
132-
meta = AdapterMeta(
133-
accepts={TaskKind.GOTO_POSE},
134-
bringup=Nav2Bringup,
135-
cap="mobile",
136-
client=GotoPoseClient,
137-
)
138-
assert meta.displays == ()

task_generator/tests/ros/test_goto_phase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def _make_robot_manager_stub(pose, goal_tolerance_distance=0.3, goal_tolerance_a
2121
)
2222
return SimpleNamespace(
2323
pose=pose,
24+
controls_orientation=True,
2425
node=SimpleNamespace(conf=SimpleNamespace(Robot=robot_conf)),
2526
)
2627

task_generator/tests/ros/test_goto_phase_property.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def _stub(pose, tol_dist, tol_ang):
2828
)
2929
return SimpleNamespace(
3030
pose=pose,
31+
controls_orientation=True,
3132
node=SimpleNamespace(conf=SimpleNamespace(Robot=robot_conf)),
3233
)
3334

task_generator/tests/ros/test_known_obstacles.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ def test_obstacle_layer_integer_values():
2323
assert ObstacleLayer.WORLD == 2
2424

2525

26-
def test_known_obstacle_defaults():
27-
from task_generator.simulators.human.utils import KnownObstacle, ObstacleLayer
28-
ko = KnownObstacle(obstacle="payload")
29-
assert ko.spawned is False
30-
assert ko.layer is ObstacleLayer.UNUSED
31-
32-
3326
def test_create_or_get_creates_on_first_call():
3427
from task_generator.simulators.human.utils import KnownObstacles
3528
known = KnownObstacles()

0 commit comments

Comments
 (0)