1
0

Use aenum to allow for third party extensions.
All checks were successful
Python Package / Package (push) Has been skipped

This commit is contained in:
Jon Michael Aanes 2023-12-19 23:08:54 +01:00
parent 55989ec085
commit 1d04d84788
3 changed files with 14 additions and 3 deletions

View File

@ -8,7 +8,7 @@ setup(
author_email='jonjmaa@gmail.com', author_email='jonjmaa@gmail.com',
url='https://gitfub.space/Jmaa/socials-util', url='https://gitfub.space/Jmaa/socials-util',
packages=['socials_util'], packages=['socials_util'],
install_requires=['enforce-typing'], install_requires=['enforce-typing', 'aenum'],
keywords=[], keywords=[],
classifiers=[], classifiers=[],
include_package_data=True, include_package_data=True,

View File

@ -5,12 +5,12 @@ Small utility for detecting social websites.
from dataclasses import dataclass from dataclasses import dataclass
from enforce_typing import enforce_types from enforce_typing import enforce_types
from typing import List, Set, Optional, Union from typing import List, Set, Optional, Union
import enum import aenum
import datetime import datetime
import re import re
import urllib.parse import urllib.parse
class SocialSiteId(enum.Enum): class SocialSiteId(aenum.Enum):
''' '''
The great social website enum. The great social website enum.
''' '''

11
test/test_extension.py Normal file
View File

@ -0,0 +1,11 @@
from socials_util import *
import aenum
def test_extension():
MY_SECRET_SITE = aenum.extend_enum(SocialSiteId, 'MY_SECRET_SITE', 666)
assert MY_SECRET_SITE
assert SocialSiteId.MY_SECRET_SITE
REGEXES.append(('test', MY_SECRET_SITE))