Skip to content

Conversation

@0xbyt4
Copy link
Collaborator

@0xbyt4 0xbyt4 commented Feb 10, 2026

Add comprehensive unit tests for all 14 previously untested action connectors with 207 new tests, all passing.

Add comprehensive unit tests covering all previously untested action
connectors: move/ros2, tweet/twitterAPI, move_serial_arduino,
move_tron/tron_sdk, arm_g1/unitree_sdk, emotion/unitree_sdk,
move_go2_action/unitree_sdk, move_to_peer/ros2, navigate_location
(g1+go2), remember_location (g1+go2), selfie, emergency_alert,
move_turtle (zenoh+zenoh_remote), and move_ub/yanshee_motion.

194 new tests total, all passing.
- Fix meaningless assertion in _send_command test (always-true removed)
- Add _send_command tests: reset return value, non-reset auto-reset,
  ValueError handling
- Add all missing connect() action tests for move_ub (walk left/right,
  look left/right, crouch, come on, WakaWaka, RaiseRightHand, PushUp)
- Add zenoh_remote init tests: WebSocket URL with api_key, cmd_vel
  topic without URID, callback registration verification
- Verify session.put receives correct cmd_vel topic
@0xbyt4 0xbyt4 requested a review from a team as a code owner February 10, 2026 21:10
@github-actions github-actions bot added python Python code tests Test files labels Feb 10, 2026
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

- arm_g1/test_unitree_sdk.py -> test_arm_g1_unitree_sdk.py
- emotion/test_unitree_sdk.py -> test_emotion_unitree_sdk.py
- move_go2_action/test_unitree_sdk.py -> test_go2_action_unitree_sdk.py
…ests

Module-level sys.modules mocking was leaking into other test modules
during pytest collection, causing CI failures (dds_ NameError).

Each test file now stores its mocked entries in a _mocked_modules dict
and cleans them up in teardown_module() with an identity check to avoid
removing mocks owned by other test files.

Also removed unnecessary zenoh_msgs mocking from 4 files since it is a
real package available in the test environment.
Module-scoped patch.dict("sys.modules") fixtures were cleaning up
after each test module, leaving cached connector imports with stale
mock references. In CI where real packages (zenoh, etc.) are installed,
this caused background threads to open real connections, preventing
the test process from terminating. Changed to session scope to match
the pattern used by existing tests (test_avatar.py, test_fabric.py).
…iles

Module-level imports of connectors that cascade to `import zenoh` (a Rust
package with non-daemon tokio threads) caused the pytest process to hang
indefinitely after all tests passed. Convert to lazy imports inside
fixtures/tests so session-scoped sys.modules mocks are active first.

Files fixed: test_unitree_nav.py, test_unitree_location.py, test_selfie.py
@openminddev
Copy link
Contributor

Hi @0xbyt4 Could you please move import to the top?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants