Paper Dynasty Discord - Discord bot for card game
Go to file
Cal Corum 00ed42befd Add tests for play lock release and cross-command racing
Adds two new test cases to test_play_locking.py to improve coverage:

1. test_lock_released_after_successful_completion
   - Verifies play.locked is set to False after complete_play()
   - Confirms play.complete is set to True
   - Validates database commit is called

2. test_different_commands_racing_on_locked_play
   - Tests that ANY command type is blocked on locked plays
   - Prevents race conditions between different command types
   - Tests multiple commands: walk, strikeout, single, xcheck

These tests ensure the play locking idempotency guard works correctly
for both lock acquisition and release, and prevents all command types
from racing (not just duplicate commands).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 17:13:57 -06:00
.plans Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00
.vscode Catchup commit 2025-07-22 09:22:19 -05:00
cogs Fix pack type grouping logic in packs display 2026-01-08 14:22:06 -06:00
command_logic Fix unawaited coroutine in singles() command (SPD hit result) 2025-11-17 22:37:51 -06:00
discord_ui Normalize Player.franchise queries to use Team.sname 2026-01-07 12:01:00 -06:00
helpers Add API timeout/retry logic and fix get_team_by_owner for PostgreSQL 2026-01-31 15:52:14 -06:00
in_game Add pitcher validation with rank retry in get_starting_pitcher 2026-01-30 14:04:03 -06:00
migrations Update cache refresh logic to replace vs delete 2025-02-23 22:50:58 -06:00
tests Add tests for play lock release and cross-command racing 2026-02-03 17:13:57 -06:00
utilities Fix bot crash when substituting player without eligible position 2025-11-12 16:02:35 -06:00
.dockerignore Catchup commit 2025-07-22 09:22:19 -05:00
.gitignore Catchup commit 2025-07-22 09:22:19 -05:00
alembic.ini Added base alembic config 2024-10-11 16:42:15 -05:00
api_calls.py Add API timeout/retry logic and fix get_team_by_owner for PostgreSQL 2026-01-31 15:52:14 -06:00
constants.py Fix Athletics Team Choice pack KeyError 2026-01-04 16:20:05 -06:00
db_calls_gameplay.py Update logging to RotatingFileHandler 2024-11-09 23:14:54 -06:00
deploy.sh Add HTTP health check endpoint for container monitoring 2025-11-12 14:44:53 -06:00
DEPLOYMENT.md Catchup files 2025-11-11 13:22:06 -06:00
dice.py Remove outdate image links 2025-06-04 09:54:13 -05:00
discord_utils.py Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00
Dockerfile Added docker to environment 2024-10-12 02:04:30 -05:00
exceptions.py Add API timeout/retry logic and fix get_team_by_owner for PostgreSQL 2026-01-31 15:52:14 -06:00
gauntlets.py Add API timeout/retry logic and fix get_team_by_owner for PostgreSQL 2026-01-31 15:52:14 -06:00
health_server.py Add HTTP health check endpoint for container monitoring 2025-11-12 14:44:53 -06:00
help_text.py S10 Updates + PR Bugfix 2025-11-09 06:12:46 -06:00
helpers.py Add API timeout/retry logic and fix get_team_by_owner for PostgreSQL 2026-01-31 15:52:14 -06:00
LICENSE Initial commit 2020-07-07 13:56:19 -05:00
manual_pack_distribution.py S10 Updates + PR Bugfix 2025-11-09 06:12:46 -06:00
paperdynasty.py Add HTTP health check endpoint for container monitoring 2025-11-12 14:44:53 -06:00
PRODUCTION_COGS.md DOCS: Add production cogs documentation for future reference 2025-11-10 09:46:11 -06:00
pytest.ini Catchup commit 2025-07-22 09:22:19 -05:00
random_content.py Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00
requirements.txt Fix numpy CPU compatibility issue (X86_V2) 2026-01-08 14:04:18 -06:00
search_utils.py Catchup commit 2025-07-22 09:22:19 -05:00
utils.py CLAUDE: Fix get_roster_sheet() to handle both dict and Team objects 2025-11-10 09:11:37 -06:00
VERSION Bump version to 1.7.13 2026-01-31 15:53:07 -06:00