Skip to content

Test/add emotion action tests#2131

Open
LupaFlex wants to merge 3 commits intoOpenMind:mainfrom
LupaFlex:test/add-emotion-action-tests
Open

Test/add emotion action tests#2131
LupaFlex wants to merge 3 commits intoOpenMind:mainfrom
LupaFlex:test/add-emotion-action-tests

Conversation

@LupaFlex
Copy link

@LupaFlex LupaFlex commented Feb 5, 2026

Summary

Added comprehensive unit tests for the emotion action module which previously had no test coverage.

Changes

  • tests/actions/emotion/test_interface.py: Tests for EmotionAction enum, EmotionInput dataclass, and Emotion interface
  • tests/actions/emotion/connector/test_unitree_sdk.py: Tests for EmotionUnitreeConfig and EmotionUnitreeConnector

Test Coverage

  • EmotionAction enum values and type validation
  • EmotionInput creation with all action types
  • Emotion interface with input/output handling
  • EmotionUnitreeConfig default and custom values
  • EmotionUnitreeConnector initialization with/without ethernet
  • LED control for all emotions (happy, sad, mad, curious)
  • Tick method behavior

Testing

  • All 17 tests pass
  • Pre-commit checks pass
  • Ruff linting passes

Notes

  • Follows existing test patterns (no __init__.py files in test directories)
  • Uses proper module mocking for external dependencies

@LupaFlex LupaFlex requested a review from a team as a code owner February 5, 2026 21:13
@github-actions github-actions bot added python Python code tests Test files labels Feb 5, 2026
@0xbyt4
Copy link
Collaborator

0xbyt4 commented Feb 5, 2026

Hi @LupaFlex, thanks for removing the init.py files! However, the other issues from #2129 review still remain — please see tests as reference: use scope="session", add reset_mocks fixture, move imports to top-level, and verify SetTimeout/Init/LedControl calls in init test.

@LupaFlex
Copy link
Author

LupaFlex commented Feb 5, 2026

Hi @0xbyt4 thanks for the detailed feedback I've addressed all the points

  • Added reset_mocks fixture with autouse=True
  • Moved imports to top-level (after module-level mocking)
  • Added verification for SetTimeout, Init, and LedControl calls in test_init_with_ethernet

@LupaFlex
Copy link
Author

LupaFlex commented Feb 7, 2026

hi @0xbyt4 I have fixed it

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