1
0

Ruff format
All checks were successful
Python Package / Package (push) Successful in 19s

This commit is contained in:
Jon Michael Aanes 2024-05-12 19:34:00 +02:00
parent c067f1c9ae
commit 77c64df35b
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
2 changed files with 14 additions and 4 deletions

View File

@ -408,6 +408,7 @@ WELL_KNOWN_MASTODON_INSTANCES: frozenset[str] = frozenset(
DISALLOWED_IDENTIFIERS: frozenset[str] = frozenset({'www'}) DISALLOWED_IDENTIFIERS: frozenset[str] = frozenset({'www'})
def determine_social_from_url_internally( def determine_social_from_url_internally(
url: str, url: str,
) -> tuple[SocialSiteId | None, str | None]: ) -> tuple[SocialSiteId | None, str | None]:

View File

@ -7,10 +7,18 @@ PARSABLE_SOCIAL_IDS_COMBINED = [
('https://triviallytrue.tumblr.com/', SocialSiteId.TUMBLR, 'triviallytrue'), ('https://triviallytrue.tumblr.com/', SocialSiteId.TUMBLR, 'triviallytrue'),
('https://tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), ('https://tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
('https://tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), ('https://tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
('https://tumblr.com/blog/view/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), (
'https://tumblr.com/blog/view/triviallytrue',
SocialSiteId.TUMBLR,
'triviallytrue',
),
('https://www.tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), ('https://www.tumblr.com/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
('https://www.tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), ('https://www.tumblr.com/blog/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'),
('https://www.tumblr.com/blog/view/triviallytrue', SocialSiteId.TUMBLR, 'triviallytrue'), (
'https://www.tumblr.com/blog/view/triviallytrue',
SocialSiteId.TUMBLR,
'triviallytrue',
),
] ]
PARSABLE_SOCIAL_IDS = [ PARSABLE_SOCIAL_IDS = [
@ -24,7 +32,7 @@ PARSABLE_SOCIAL_IDS = [
('https://www.tiktok.com/@depthsofwikipedia?lang=en', 'depthsofwikipedia'), ('https://www.tiktok.com/@depthsofwikipedia?lang=en', 'depthsofwikipedia'),
('https://www.pixiv.net/users/14866303', '14866303'), ('https://www.pixiv.net/users/14866303', '14866303'),
('https://www.pixiv.net/member.php?id=109710', '109710'), ('https://www.pixiv.net/member.php?id=109710', '109710'),
] + [(a,c) for (a,b,c) in PARSABLE_SOCIAL_IDS_COMBINED] ] + [(a, c) for (a, b, c) in PARSABLE_SOCIAL_IDS_COMBINED]
PARSABLE_SOCIAL_SITE_IDS = [ PARSABLE_SOCIAL_SITE_IDS = [
('https://www.deviantart.com/solquiet', SocialSiteId.DEVIANT_ART_ACCOUNT), ('https://www.deviantart.com/solquiet', SocialSiteId.DEVIANT_ART_ACCOUNT),
@ -36,7 +44,8 @@ PARSABLE_SOCIAL_SITE_IDS = [
('https://www.instagram.com/timkongart/', SocialSiteId.INSTAGRAM_PAGE), ('https://www.instagram.com/timkongart/', SocialSiteId.INSTAGRAM_PAGE),
('https://www.instagram.com/kcn.wu/', SocialSiteId.INSTAGRAM_PAGE), ('https://www.instagram.com/kcn.wu/', SocialSiteId.INSTAGRAM_PAGE),
('https://www.instagram.com/itsbettyjiang', SocialSiteId.INSTAGRAM_PAGE), ('https://www.instagram.com/itsbettyjiang', SocialSiteId.INSTAGRAM_PAGE),
] + [(a,b) for (a,b,c) in PARSABLE_SOCIAL_IDS_COMBINED] ] + [(a, b) for (a, b, c) in PARSABLE_SOCIAL_IDS_COMBINED]
@pytest.mark.parametrize('url,expected_social_id', PARSABLE_SOCIAL_IDS) @pytest.mark.parametrize('url,expected_social_id', PARSABLE_SOCIAL_IDS)
def test_parse_social_ids(url, expected_social_id): def test_parse_social_ids(url, expected_social_id):