Description
The ros_mcp/utils/ package contains core utility functions used across all tools, but currently has no unit test coverage. The existing tests/installation/ directory only verifies package installation (Docker-based), not functional correctness.
Scope
Unit tests for the following modules:
utils/response.py
_check_response() — validates rosbridge response structure
_safe_get_values() — safely extracts nested values
_extract_error() — extracts error messages from responses
utils/config_utils.py
load_robot_config() — loads and validates robot YAML specs
get_verified_robot_spec_util() — parses verified robot specification
get_verified_robots_list_util() — lists available robot specifications
utils/network_utils.py
_resolve_dns() — DNS resolution with IP detection
ping_ip_and_port() — network connectivity diagnostics (mocked)
Proposed Structure
tests/
├── installation/ # existing
└── unit/ # new
├── __init__.py
├── conftest.py # shared fixtures
├── test_response.py
├── test_config_utils.py
└── test_network_utils.py
Notes
Description
The
ros_mcp/utils/package contains core utility functions used across all tools, but currently has no unit test coverage. The existingtests/installation/directory only verifies package installation (Docker-based), not functional correctness.Scope
Unit tests for the following modules:
utils/response.py_check_response()— validates rosbridge response structure_safe_get_values()— safely extracts nested values_extract_error()— extracts error messages from responsesutils/config_utils.pyload_robot_config()— loads and validates robot YAML specsget_verified_robot_spec_util()— parses verified robot specificationget_verified_robots_list_util()— lists available robot specificationsutils/network_utils.py_resolve_dns()— DNS resolution with IP detectionping_ip_and_port()— network connectivity diagnostics (mocked)Proposed Structure
Notes
tmp_pathandmonkeypatchfor isolationpyproject.tomltests/integration/