Skip to content

Addressing PR comments#129

Merged
psykzz merged 6 commits intomainfrom
claude/expand-test-coverage
Mar 29, 2026
Merged

Addressing PR comments#129
psykzz merged 6 commits intomainfrom
claude/expand-test-coverage

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 28, 2026

No description provided.

@Claude Claude AI assigned Claude and psykzz Mar 28, 2026
@Claude Claude AI linked an issue Mar 28, 2026 that may be closed by this pull request
Claude AI and others added 3 commits March 28, 2026 10:55
…t Roles tests

- Created pytest configuration (pytest.ini, .coveragerc)
- Added requirements-test.txt with test dependencies
- Implemented comprehensive mock utilities in tests/conftest.py
  - Mock Discord objects (Bot, Guild, Member, Channel, Message, etc.)
  - Mock Red-DiscordBot Config system
  - Shared pytest fixtures for common test objects
- Added 27 unit tests for Movie Vote cog
  - IMDB link parsing and validation
  - Movie management (add, remove, watch/unwatch)
  - Vote counting and scoring
  - Leaderboard generation and filtering
  - Emoji configuration
  - Complete lifecycle workflows
- Added 18 unit tests for React Roles cog
  - Configuration setup and persistence
  - Type consistency tests (addresses bug #119)
  - Role assignment and removal logic
  - Multiple reactions per message
  - Edge cases and error handling
- Updated CI workflow to run pytest tests
- Added comprehensive test documentation in tests/README.md
- All 45 tests passing

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/362f531a-da40-41ba-8771-57e31be89cde

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
…ration

- Added comprehensive tests for Hat cog configuration (scale, rotation, offsets, flip)
- Image dimension and position calculation tests
- Scale and rotation validation tests
- Image processing tests (flipping, aspect ratio, bytes conversion)
- Edge cases (zero dimensions, negative values, extreme rotations)
- Configuration persistence tests
- Integration tests for complete workflows
- All 76 tests passing (27 Movie Vote + 18 React Roles + 31 Hat)

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/362f531a-da40-41ba-8771-57e31be89cde

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
- Created TEST_COVERAGE_SUMMARY.md with detailed overview
- Documented all 76 tests across 3 cogs
- Explained test infrastructure and mock utilities
- Provided benefits, future improvements, and usage guide
- 2,058 lines of test code total
- All tests passing with comprehensive coverage

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/362f531a-da40-41ba-8771-57e31be89cde

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Expand test coverage for cogs functionality Expand test coverage beyond basic import tests Mar 28, 2026
@Claude Claude AI requested a review from psykzz March 28, 2026 11:00
@psykzz
Copy link
Copy Markdown
Owner

psykzz commented Mar 28, 2026

@claude[agent] fix this issue

[9](https://github.com/psykzz/cogs/actions/runs/23683763279/job/68999847366?pr=129#step:4:20)
ERROR: Could not find a version that satisfies the requirement unittest-mock>=1.5.0 (from versions: none)
ERROR: No matching distribution found for unittest-mock>=1.5.0

The unittest.mock module is part of Python's standard library since Python 3.3
and doesn't need to be installed separately. Removed the invalid unittest-mock>=1.5.0
requirement that was causing CI installation to fail.

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/6d8109cf-9951-4321-b2bb-ff470111bd53

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Mar 28, 2026

@claude[agent] fix this issue

[9](https://github.com/psykzz/cogs/actions/runs/23683763279/job/68999847366?pr=129#step:4:20)

...

Fixed in 460d296. The unittest.mock module is part of Python's standard library since Python 3.3, so the unittest-mock>=1.5.0 dependency was invalid and has been removed from requirements-test.txt. All 76 tests still pass.

@Claude Claude AI changed the title Expand test coverage beyond basic import tests Addressing PR comments Mar 28, 2026
@psykzz
Copy link
Copy Markdown
Owner

psykzz commented Mar 28, 2026

@claude[agent] fix the linting now.


/opt/hostedtoolcache/Python/3.11.15/x64/bin/flake8 .
./tests/conftest.py:9:1: F401 'unittest.mock.AsyncMock' imported but unused
./tests/conftest.py:9:1: F401 'unittest.mock.Mock' imported but unused
./tests/conftest.py:10:1: F401 'typing.Dict' imported but unused
./tests/test_hat.py:133:9: F841 local variable 'hat_name' is assigned to but never used
./tests/test_movie_vote.py:15:1: F401 'unittest.mock.AsyncMock' imported but unused
./tests/test_movie_vote.py:15:1: F401 'unittest.mock.MagicMock' imported but unused
./tests/test_movie_vote.py:15:1: F401 'unittest.mock.patch' imported but unused
./tests/test_react_roles.py:14:1: F401 'unittest.mock.AsyncMock' imported but unused
./tests/test_react_roles.py:14:1: F401 'unittest.mock.MagicMock' imported but unused
./tests/test_react_roles.py:14:1: F401 'unittest.mock.Mock' imported but unused
Error: The process '/opt/hostedtoolcache/Python/3.11.15/x64/bin/flake8' failed with exit code 1

- Removed unused imports (AsyncMock, Mock, patch) from test files
- Removed unused Dict import from conftest.py
- Removed unused hat_name variable in test_hat.py
- Kept MagicMock import in conftest.py as it's used for permissions mock
- All 76 tests still passing
- Flake8 reports 0 errors

Agent-Logs-Url: https://github.com/psykzz/cogs/sessions/6d6156ac-eab1-400a-84fc-3b5ea1690cc5

Co-authored-by: psykzz <1134201+psykzz@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Mar 28, 2026

@claude[agent] fix the linting now.


...

Fixed in 05d5cfd. Removed all unused imports and the unused hat_name variable. Flake8 now reports 0 errors and all 76 tests still pass.

@psykzz psykzz marked this pull request as ready for review March 29, 2026 19:59
@psykzz psykzz merged commit 232f0e3 into main Mar 29, 2026
3 checks passed
@psykzz psykzz deleted the claude/expand-test-coverage branch March 29, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧪 Expand test coverage beyond basic import tests

2 participants