Skip to content

tests(discord-bridge, telegram-bridge): task-file fields + allowlist coverage - #1239

Closed
bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:tests/py-bridges-tofu-compat-fix
Closed

bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:tests/py-bridges-tofu-compat-fix

Conversation

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator

Replacement for #1226 — stripped to only the two novel test files (dropped slack-bridge-tofu.test.py which conflicts with open PR #1190, and py39-compat-remaining.test.py which overlaps with #1188/#1199).

Files

tests/discord-bridge-task-file-fields.test.py — 5 structural guards for the PR #1077 port that added channel_name, guild_name, source_message_id to discord task files:

  1. channel_name field present in task_file.write_text block
  2. guild_name field present
  3. source_message_id field present
  4. Newline sanitization applied to human-readable fields
  5. DM fallback ("DM") used when channel has no .name / guild is None

tests/telegram-bridge-allowlist.test.py — 13 behavioral tests, first coverage for telegram-bridge.py access control:

  • load_allowed() returns None (TOFU-eligible), set() (locked), {id} (restricted) under each access.json state
  • tofu_onboard() writes the file on first install, is idempotent on re-run

Both tests pass locally.

🤖 Generated with Claude Code

…tests

Adds two targeted test files extracted from PR sonichi#1226 after stripping the
conflicting slack-bridge-tofu and py39-compat files (which overlap with
open PRs sonichi#1190 and sonichi#1188/sonichi#1199 respectively).

- tests/discord-bridge-task-file-fields.test.py (5 guards): verifies PR sonichi#1077
  port — task file includes channel_name, guild_name, source_message_id, DM
  fallback ("DM"), and newline sanitization.
- tests/telegram-bridge-allowlist.test.py (13 tests): first coverage for
  telegram-bridge.py access control — load_allowed() behavior under each
  access.json state, and tofu_onboard() writes on first install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@VasiliyRad VasiliyRad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean — these are the two novel test files I called out in my RC of #1226 ('discord-bridge-task-file-fields' + 'telegram-bridge-allowlist'). Properly extracted from the bundle this time. 2 files, no source changes, no bundling. LGTM 👍

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Closing per owner instruction — autonomous PR creation halted.

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.

2 participants