Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ssvc/namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class NameSpace(StrEnum):
BASIC = auto()
EXAMPLE = auto()
TEST = auto()
INVALID = auto()

@classmethod
def validate(cls, value: str) -> str:
Expand All @@ -77,6 +78,13 @@ def validate(cls, value: str) -> str:
ValueError: if the value is not a valid namespace

"""

if value in cls.__members__.values():
# value is an unadorned registered namespace
# so we're done
return value

# check against known pattern
valid = NS_PATTERN.match(value)

if valid:
Expand Down