fix(test-entity): resolve ValueError when coercing foreign TestState enum
str() on models.enums.TestState produces 'TestState.red_executing' instead of 'red_executing'. Use .value to extract the plain string before constructing the domain TestState.
This commit is contained in:
@@ -166,7 +166,8 @@ class TestEntity:
|
||||
|
||||
Raises :class:`InvalidStateTransition` when the move is illegal.
|
||||
"""
|
||||
resolved = target if isinstance(target, TestState) else TestState(str(target))
|
||||
value = target.value if hasattr(target, "value") else str(target)
|
||||
resolved = target if isinstance(target, TestState) else TestState(value)
|
||||
return self._transition(resolved)
|
||||
|
||||
def _transition(self, target: TestState) -> str:
|
||||
|
||||
Reference in New Issue
Block a user