1
0
socials-util/test/test_extension.py
Jon Michael Aanes 1396391fbb
Some checks are pending
Python Ruff Code Quality / ruff (push) Waiting to run
Run Python tests (through Pytest) / Test (push) Waiting to run
Verify Python project can be installed, loaded and have version checked / Test (push) Waiting to run
Code quality
2024-10-20 19:38:14 +02:00

18 lines
486 B
Python

import aenum
import socials_util
def test_extension():
my_secret_site = aenum.extend_enum(socials_util.SocialSiteId, 'MY_SECRET_SITE', 666)
assert my_secret_site
assert socials_util.SocialSiteId.MY_SECRET_SITE
socials_util.REGEXES.append((r'test(\d+)', my_secret_site))
url = 'test123'
result = socials_util.determine_social_from_url(url)
assert result is not None
assert result.social_site_id == my_secret_site
assert result.social_id == '123'