Skip to content

Commit

Permalink
Use @unique to ensure and communicate enum uniqueness
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtheturtle committed Nov 4, 2024
1 parent b11c8f2 commit 87d850c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mock_vws/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Constants used to make the VWS mock.
"""

from enum import Enum
from enum import Enum, unique

from beartype import beartype


@beartype
@unique
class ResultCodes(Enum):
"""Constants representing various VWS result codes.
Expand Down Expand Up @@ -42,6 +43,7 @@ class ResultCodes(Enum):


@beartype
@unique
class TargetStatuses(Enum):
"""Constants representing VWS target statuses.
Expand Down
3 changes: 2 additions & 1 deletion src/mock_vws/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
Vuforia database states.
"""

from enum import StrEnum, auto
from enum import StrEnum, auto, unique

from beartype import beartype


@beartype
@unique
class States(StrEnum):
"""
Constants representing various web service states.
Expand Down

0 comments on commit 87d850c

Please sign in to comment.