From b1e653a61c660b604d0cbb3d15100ac87ed6e4f4 Mon Sep 17 00:00:00 2001 From: Rafal Stefanowski Date: Fri, 13 Dec 2019 17:58:53 +0100 Subject: [PATCH] Add string representation for cache mode When relating to CacheMode enum, returned value was for example "CacheMode.WT" which doesn't look very pretty in logs or output. Signed-off-by: Rafal Stefanowski --- test/functional/api/cas/cache_config.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/functional/api/cas/cache_config.py b/test/functional/api/cas/cache_config.py index 6c0181b..1768136 100644 --- a/test/functional/api/cas/cache_config.py +++ b/test/functional/api/cas/cache_config.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear # -from enum import IntEnum, Enum +from enum import IntEnum +from aenum import Enum from test_utils.size import Size, Unit from datetime import timedelta @@ -18,13 +19,16 @@ class CacheLineSize(IntEnum): class CacheMode(Enum): - WT = 0 - WB = 1 - WA = 2 - PT = 3 - WO = 4 + WT = "Write-Through" + WB = "Write-Back" + WA = "Write-Around" + PT = "Pass-Through" + WO = "Write-Only" DEFAULT = WT + def __str__(self): + return self.value + class SeqCutOffPolicy(Enum): full = 0