quick commit
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s

This commit is contained in:
2026-01-17 20:24:43 +01:00
parent 95cc3cdb8f
commit 831eed8dbc
82 changed files with 8860 additions and 167 deletions

View File

@@ -2,7 +2,6 @@
import pytest
from guardden.models import BannedWord
from guardden.services.automod import AutomodService
@@ -79,6 +78,14 @@ class TestScamDetection:
result = automod.check_scam_links("Visit discord-verify.xyz to claim")
assert result is not None
def test_allowlisted_domain(self, automod: AutomodService) -> None:
"""Test allowlisted domains skip suspicious TLD checks."""
result = automod.check_scam_links(
"Visit https://discordapp.xyz for updates",
allowlist=["discordapp.xyz"],
)
assert result is None
def test_normal_url(self, automod: AutomodService) -> None:
"""Test normal URLs pass."""
result = automod.check_scam_links("Check out https://github.com/example")