feat(transforms): support for Username and SocialAccount

This commit is contained in:
dextmorgn
2025-11-17 16:55:26 +01:00
parent c51205dec3
commit 1fb2c78914
5 changed files with 67 additions and 64 deletions

View File

@@ -1,6 +1,6 @@
from pathlib import Path
from flowsint_transforms.socials.maigret import MaigretTransform
from flowsint_types.social import SocialProfile
from flowsint_types.social import SocialAccount
transform = MaigretTransform("sketch_123", "scan_123")
@@ -12,15 +12,15 @@ def test_unprocessed_valid_usernames():
]
result = transform.preprocess(usernames)
result_usernames = [d for d in result]
expected_usernames = [SocialProfile(username=d) for d in usernames]
expected_usernames = [SocialAccount(username=d) for d in usernames]
assert result_usernames == expected_usernames
def test_preprocess_invalid_usernames():
usernames = [
SocialProfile(username="toto123"),
SocialProfile(username="DorianXd78_Official"),
SocialProfile(username="This is not a username"),
SocialAccount(username="toto123"),
SocialAccount(username="DorianXd78_Official"),
SocialAccount(username="This is not a username"),
]
result = transform.preprocess(usernames)
@@ -34,7 +34,7 @@ def test_preprocess_multiple_formats():
usernames = [
{"username": "toto123"},
{"invalid_key": "ValId_UseRnAme"},
SocialProfile(username="DorianXd78_Official"),
SocialAccount(username="DorianXd78_Official"),
"MySimpleUsername",
]
result = transform.preprocess(usernames)