first round of review

This commit is contained in:
counterweight 2025-12-19 10:30:23 +01:00
parent 5908660e56
commit 7140cf6f27
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
9 changed files with 61 additions and 63 deletions

View file

@ -397,4 +397,3 @@ class TestProfilePrivacy:
assert "telegram" not in data
assert "signal" not in data
assert "nostr_npub" not in data

View file

@ -61,8 +61,8 @@ class TestValidateTelegram:
assert validate_telegram("@alice_bob") is None
def test_valid_handle_min_length(self):
# 5 characters after @
assert validate_telegram("@abcde") is None
# 1 character after @
assert validate_telegram("@a") is None
def test_valid_handle_max_length(self):
# 32 characters after @
@ -77,26 +77,20 @@ class TestValidateTelegram:
result = validate_telegram("@")
assert result is not None
def test_too_short(self):
# Less than 5 characters after @
result = validate_telegram("@abcd")
assert result is not None
assert "5" in result
def test_too_long(self):
# More than 32 characters after @
result = validate_telegram("@" + "a" * 33)
assert result is not None
assert "32" in result
def test_starts_with_number(self):
result = validate_telegram("@1alice")
assert result is not None
assert "letter" in result.lower()
def test_starts_with_number_is_valid(self):
# Now allowed - any character is valid
assert validate_telegram("@1alice") is None
def test_invalid_characters(self):
result = validate_telegram("@alice-bob")
assert result is not None
def test_special_characters_are_valid(self):
# Now allowed - any character is valid
assert validate_telegram("@alice-bob") is None
assert validate_telegram("@test.user") is None
class TestValidateSignal: