test-api: add string representation of SeqCutOffPolicy
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
parent
4ebc00bac8
commit
908672fd66
@ -72,9 +72,9 @@ class CacheMode(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class SeqCutOffPolicy(Enum):
|
class SeqCutOffPolicy(Enum):
|
||||||
full = 0
|
full = "full"
|
||||||
always = 1
|
always = "always"
|
||||||
never = 2
|
never = "never"
|
||||||
DEFAULT = full
|
DEFAULT = full
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -85,6 +85,9 @@ class SeqCutOffPolicy(Enum):
|
|||||||
|
|
||||||
raise ValueError(f"{name} is not a valid sequential cut off name")
|
raise ValueError(f"{name} is not a valid sequential cut off name")
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.value
|
||||||
|
|
||||||
|
|
||||||
class MetadataMode(Enum):
|
class MetadataMode(Enum):
|
||||||
normal = "normal"
|
normal = "normal"
|
||||||
|
@ -173,7 +173,11 @@ def test_activate_incomplete_cache():
|
|||||||
TestRun.fail(f"Expected one inactive core. Got {inactive_core_count}")
|
TestRun.fail(f"Expected one inactive core. Got {inactive_core_count}")
|
||||||
|
|
||||||
with TestRun.step("Check if core is in an appropriate state"):
|
with TestRun.step("Check if core is in an appropriate state"):
|
||||||
core_status = CoreStatus[get_core_info_by_path(core_dev_path)["status"].lower()]
|
core_status = CoreStatus[
|
||||||
|
get_core_info_by_path(core_disk_path=core_dev_path, target_cache_id=cache.cache_id)[
|
||||||
|
"status"
|
||||||
|
].lower()
|
||||||
|
]
|
||||||
if core_status != CoreStatus.inactive:
|
if core_status != CoreStatus.inactive:
|
||||||
TestRun.fail(
|
TestRun.fail(
|
||||||
"The core is in an invalid state. "
|
"The core is in an invalid state. "
|
||||||
|
Loading…
Reference in New Issue
Block a user