Skip to content

Commit b45911d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 861ec2f commit b45911d

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

src/models/europython.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def extract_linkedin_url(text: str) -> str:
123123
@staticmethod
124124
def extract_bluesky_url(text: str) -> str:
125125
"""
126-
Returns a normalized BlueSky URL in the form https://bsky.app/profile/<USERNAME>.bsky.social,
127-
or uses the entire domain if it's custom (e.g., .dev).
126+
Returns a normalized BlueSky URL in the form https://bsky.app/profile/<USERNAME>.bsky.social,
127+
or uses the entire domain if it's custom (e.g., .dev).
128128
"""
129129
text = text.split("?", 1)[0].strip()
130130

@@ -145,7 +145,7 @@ def extract_bluesky_url(text: str) -> str:
145145
text = text.rsplit("/", 1)[-1]
146146

147147
# if there's no dot, assume it's a non-custom handle and append '.bsky.social'
148-
if '.' not in text:
148+
if "." not in text:
149149
text += ".bsky.social"
150150

151151
return f"https://bsky.app/profile/{text}"

tests/test_social_media_extractions.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_extract_mastodon_url(input_string: str, result: str) -> None:
3333
def test_extract_linkedin_url(input_string: str, result: str) -> None:
3434
assert EuroPythonSpeaker.extract_linkedin_url(input_string) == result
3535

36+
3637
@pytest.mark.parametrize(
3738
("input_string", "result"),
3839
[
@@ -41,12 +42,27 @@ def test_extract_linkedin_url(input_string: str, result: str) -> None:
4142
("username.bsky.social", "https://bsky.app/profile/username.bsky.social"),
4243
("bsky.app/profile/username", "https://bsky.app/profile/username.bsky.social"),
4344
("bsky/username", "https://bsky.app/profile/username.bsky.social"),
44-
("www.bsky.app/profile/username", "https://bsky.app/profile/username.bsky.social"),
45-
("www.bsky.app/profile/username.bsky.social", "https://bsky.app/profile/username.bsky.social"),
46-
("http://bsky.app/profile/username", "https://bsky.app/profile/username.bsky.social"),
47-
("https://bsky.app/profile/username.com", "https://bsky.app/profile/username.com"),
48-
("https://bsky.app/profile/username.bsky.social", "https://bsky.app/profile/username.bsky.social"),
45+
(
46+
"www.bsky.app/profile/username",
47+
"https://bsky.app/profile/username.bsky.social",
48+
),
49+
(
50+
"www.bsky.app/profile/username.bsky.social",
51+
"https://bsky.app/profile/username.bsky.social",
52+
),
53+
(
54+
"http://bsky.app/profile/username",
55+
"https://bsky.app/profile/username.bsky.social",
56+
),
57+
(
58+
"https://bsky.app/profile/username.com",
59+
"https://bsky.app/profile/username.com",
60+
),
61+
(
62+
"https://bsky.app/profile/username.bsky.social",
63+
"https://bsky.app/profile/username.bsky.social",
64+
),
4965
],
5066
)
5167
def test_extract_bluesky_url(input_string: str, result: str) -> None:
52-
assert EuroPythonSpeaker.extract_bluesky_url(input_string) == result
68+
assert EuroPythonSpeaker.extract_bluesky_url(input_string) == result

0 commit comments

Comments
 (0)