ci: tests

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-06-12 16:39:08 +02:00
parent 5fdd4952a9
commit 67b6f79715
No known key found for this signature in database
25 changed files with 245 additions and 224 deletions

View file

@ -30,14 +30,14 @@ class DynamicApiMeta(EnumMeta):
try:
return super().__call__(value)
except ValueError as e:
# If the value doesn't exist, create a new enum member
# Create a new member name from the value
member_name = value.lower().replace("-", "_")
# If this value was already dynamically added, return it
if value in cls._dynamic_values:
return cls._dynamic_values[value]
# If the value doesn't exist, create a new enum member
# Create a new member name from the value
member_name = value.lower().replace("-", "_")
# If this member name already exists in the enum, return the existing member
if member_name in cls._member_map_:
return cls._member_map_[member_name]
@ -55,7 +55,7 @@ class DynamicApiMeta(EnumMeta):
def add(cls, value):
"""
Add a new API to the enum.
Particulary useful for external APIs.
Used to register external APIs.
"""
member_name = value.lower().replace("-", "_")