Skip to content

Commit fe68e41

Browse files
author
Michał Fąferek
committed
[#17] test: add requirement traceability for component data endpoint tests
Add @verifies REQ_INTEROP_018 annotations to all tests for the GET /components/{component_id}/data endpoint to establish traceability between tests and SOVD requirements.
1 parent b8d5f82 commit fe68e41

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

src/ros2_medkit_gateway/test/test_integration.test.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ def test_06_area_components_nonexistent_error(self):
272272
print('✓ Nonexistent area error test passed')
273273

274274
def test_07_component_data_powertrain_engine(self):
275-
"""Test GET /components/{component_id}/data for engine component."""
275+
"""
276+
Test GET /components/{component_id}/data for engine component.
277+
278+
@verifies REQ_INTEROP_018
279+
"""
276280
# Get data from temp_sensor component (powertrain/engine)
277281
data = self._get_json('/components/temp_sensor/data')
278282
self.assertIsInstance(data, list)
@@ -287,7 +291,11 @@ def test_07_component_data_powertrain_engine(self):
287291
print(f'✓ Engine component data test passed: {len(data)} topics')
288292

289293
def test_08_component_data_chassis_brakes(self):
290-
"""Test GET /components/{component_id}/data for brakes component."""
294+
"""
295+
Test GET /components/{component_id}/data for brakes component.
296+
297+
@verifies REQ_INTEROP_018
298+
"""
291299
# Get data from pressure_sensor component (chassis/brakes)
292300
data = self._get_json('/components/pressure_sensor/data')
293301
self.assertIsInstance(data, list)
@@ -301,7 +309,11 @@ def test_08_component_data_chassis_brakes(self):
301309
print(f'✓ Brakes component data test passed: {len(data)} topics')
302310

303311
def test_09_component_data_body_door(self):
304-
"""Test GET /components/{component_id}/data for door component."""
312+
"""
313+
Test GET /components/{component_id}/data for door component.
314+
315+
@verifies REQ_INTEROP_018
316+
"""
305317
# Get data from status_sensor component (body/door/front_left)
306318
data = self._get_json('/components/status_sensor/data')
307319
self.assertIsInstance(data, list)
@@ -315,7 +327,11 @@ def test_09_component_data_body_door(self):
315327
print(f'✓ Door component data test passed: {len(data)} topics')
316328

317329
def test_10_component_data_structure(self):
318-
"""Test GET /components/{component_id}/data response structure."""
330+
"""
331+
Test GET /components/{component_id}/data response structure.
332+
333+
@verifies REQ_INTEROP_018
334+
"""
319335
data = self._get_json('/components/temp_sensor/data')
320336
self.assertIsInstance(data, list, 'Response should be an array')
321337

@@ -336,7 +352,11 @@ def test_10_component_data_structure(self):
336352
print('✓ Component data structure test passed')
337353

338354
def test_11_component_nonexistent_error(self):
339-
"""Test GET /components/{component_id}/data returns 404 for nonexistent component."""
355+
"""
356+
Test GET /components/{component_id}/data returns 404 for nonexistent component.
357+
358+
@verifies REQ_INTEROP_018
359+
"""
340360
response = requests.get(
341361
f'{self.BASE_URL}/components/nonexistent_component/data',
342362
timeout=5
@@ -357,6 +377,8 @@ def test_12_component_no_topics(self):
357377
358378
Verifies that components with no topics return an empty array.
359379
The calibration component typically has only services, no topics.
380+
381+
@verifies REQ_INTEROP_018
360382
"""
361383
# Or test with a component that we know has no publishing topics
362384
# For now, we'll verify that any component returns an array (even if empty)

0 commit comments

Comments
 (0)