Add unit tests for nav2, person follow, and slam hooks#2032
Merged
openminddev merged 1 commit intomainfrom Feb 1, 2026
Merged
Conversation
Introduces comprehensive pytest-based unit tests for nav2_hook, person_follow_hook, and slam_hook modules. Tests cover success and error scenarios, parameter variations, timeout configurations, and integration with ElevenLabsTTSProvider where applicable.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive unit test coverage for three hook modules: nav2_hook, person_follow_hook, and slam_hook. The tests validate both successful operations and error handling scenarios for starting and stopping navigation, person-following, and SLAM functionalities.
Changes:
- Added 234 lines of tests for
nav2_hookcovering start/stop operations with various success and error scenarios - Added 374 lines of tests for
person_follow_hookcovering enrollment, tracking status, retries, and error conditions - Added 309 lines of tests for
slam_hookcovering start/stop operations including map saving functionality
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/hooks/test_nav2_hook.py | Tests for nav2 start/stop operations including HTTP errors, client errors, custom parameters, and timeout configurations |
| tests/hooks/test_person_follow_hook.py | Tests for person follow enrollment/tracking with retry logic, status polling, connection errors, and timeout handling |
| tests/hooks/test_slam_hook.py | Tests for SLAM start/stop operations including map saving, HTTP/client errors, and timeout configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds comprehensive unit tests for the
nav2_hookandperson_follow_hookmodules. The new tests cover a wide range of scenarios for both starting and stopping navigation and person-following features, including success cases, error handling, custom parameters, and correct use of timeouts and dependencies.Unit tests for nav2_hook:
start_nav2_hookcovering successful starts (with default and custom parameters), HTTP error responses (with and without JSON), client connection errors, and timeout configuration. Also verifies integration with theElevenLabsTTSProviderfor status messaging.stop_nav2_hookcovering successful stops (with default and custom parameters), HTTP error responses, client connection errors, and timeout usage.Unit tests for person_follow_hook:
start_person_follow_hookincluding first-attempt and retry successes, handling of not-tracked status, custom base URLs, client and connection errors, default constant usage, and timeout configuration. Also verifies correct messaging viaElevenLabsTTSProvider.stop_person_follow_hookcovering successful stops (default and custom URLs), HTTP and client errors, and timeout configuration.