This commit is contained in:
parent
c067f1c9ae
commit
77c64df35b
|
@ -408,6 +408,7 @@ WELL_KNOWN_MASTODON_INSTANCES: frozenset[str] = frozenset(
|
|||
|
||||
DISALLOWED_IDENTIFIERS: frozenset[str] = frozenset({'www'})
|
||||
|
||||
|
||||
def determine_social_from_url_internally(
|
||||
url: str,
|
||||
) -> tuple[SocialSiteId | None, str | None]:
|
||||
|
|
|
@ -7,10 +7,18 @@ PARSABLE_SOCIAL_IDS_COMBINED = [
|
|||
('https://triviallytrue.tumblr.com/', SocialSiteId.TUMBLR, 'triviallytrue'),
|
||||
('https://tumblr.com/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/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 = [
|
||||
|
@ -38,6 +46,7 @@ PARSABLE_SOCIAL_SITE_IDS = [
|
|||
('https://www.instagram.com/itsbettyjiang', SocialSiteId.INSTAGRAM_PAGE),
|
||||
] + [(a, b) for (a, b, c) in PARSABLE_SOCIAL_IDS_COMBINED]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('url,expected_social_id', PARSABLE_SOCIAL_IDS)
|
||||
def test_parse_social_ids(url, expected_social_id):
|
||||
social_link = determine_social_from_url(url)
|
||||
|
|
Loading…
Reference in New Issue
Block a user