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'