Skip to content

test: add unit tests for utility modules (response, config, network) #308

@Tyrrnien81

Description

@Tyrrnien81

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions