70 lines
2.1 KiB
Python
70 lines
2.1 KiB
Python
from socials_util import *
|
|
|
|
|
|
def test_parsing():
|
|
assert determine_social_from_url('http://www.twitter.com/dril').social_id == 'dril'
|
|
assert determine_social_from_url('http://worstdril.tumblr.com/')
|
|
assert (
|
|
determine_social_from_url('https://deep-dark-fears.tumblr.com').social_id
|
|
== 'deep-dark-fears'
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://www.etsy.com/shop/aleksiremesart').social_id
|
|
== 'aleksiremesart'
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://ko-fi.com/A627LI1/shop').social_id
|
|
== 'A627LI1'
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://ko-fi.com/A627LI1/').social_id == 'A627LI1'
|
|
)
|
|
assert (
|
|
determine_social_from_url(
|
|
'https://www.facebook.com/fredagscafeen.dk/'
|
|
).social_id
|
|
== 'fredagscafeen.dk'
|
|
)
|
|
assert (
|
|
determine_social_from_url(
|
|
'https://www.tiktok.com/@depthsofwikipedia?lang=en'
|
|
).social_id
|
|
== 'depthsofwikipedia'
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://www.pixiv.net/users/14866303').social_id
|
|
== '14866303'
|
|
)
|
|
assert (
|
|
determine_social_from_url(
|
|
'https://www.pixiv.net/member.php?id=109710'
|
|
).social_id
|
|
== '109710'
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://www.deviantart.com/solquiet').social_site_id
|
|
== SocialSiteId.DEVIANT_ART_ACCOUNT
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://solquiet.deviantart.com/').social_site_id
|
|
== SocialSiteId.DEVIANT_ART_ACCOUNT
|
|
)
|
|
assert (
|
|
determine_social_from_url('https://cohost.org/example').social_site_id
|
|
== SocialSiteId.COHOST_PROFILE
|
|
)
|
|
|
|
INSTAGRAMS = [
|
|
'https://instagram.com/_richardparry_',
|
|
'https://instagram.com/j_kmor/',
|
|
'https://instagram.com/cullensartbox/',
|
|
'https://www.instagram.com/timkongart/',
|
|
'https://www.instagram.com/kcn.wu/',
|
|
'https://www.instagram.com/itsbettyjiang',
|
|
]
|
|
|
|
for ig in INSTAGRAMS:
|
|
assert (
|
|
determine_social_from_url(ig).social_site_id == SocialSiteId.INSTAGRAM_PAGE
|
|
)
|