From 1e09ab54807e7a2684ee2f76299f12261089b618 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Tue, 16 Apr 2024 14:41:24 +0300 Subject: [PATCH] tests: update social network tests for new mastodon links --- tests/test_data_models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_data_models.py b/tests/test_data_models.py index 390b274..5aa204d 100644 --- a/tests/test_data_models.py +++ b/tests/test_data_models.py @@ -323,7 +323,11 @@ def test_invalid_doi(publication_entry, doi): @pytest.mark.parametrize( "network, username", - [("Mastodon", "invalidmastodon"), ("Mastodon", "@inva@l@id")], + [ + ("Mastodon", "invalidmastodon"), + ("Mastodon", "@inva@l@id"), + ("Mastodon", "@invalid@ne<>twork.com"), + ], ) def test_invalid_social_networks(network, username): with pytest.raises(pydantic.ValidationError): @@ -338,7 +342,7 @@ def test_invalid_social_networks(network, username): ("Instagram", "myusername", "https://instagram.com/myusername"), ("Orcid", "myusername", "https://orcid.org/myusername"), ("Twitter", "myusername", "https://twitter.com/myusername"), - ("Mastodon", "@myusername", "https://mastodon.social/@myusername"), + ("Mastodon", "@myusername@test.org", "https://test.org/@myusername"), ], ) def test_social_network_url(network, username, expected_url):