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 = [
@ -38,6 +46,7 @@ PARSABLE_SOCIAL_SITE_IDS = [
('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):
social_link = determine_social_from_url(url) social_link = determine_social_from_url(url)