From 081a05a6359b0d115d3bb48004ee08ebb633cd72 Mon Sep 17 00:00:00 2001 From: Daniel Madej Date: Fri, 7 Feb 2020 16:53:09 +0100 Subject: [PATCH] Get cache modes which have any of the provided traits Signed-off-by: Daniel Madej --- test/functional/api/cas/cache_config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/api/cas/cache_config.py b/test/functional/api/cas/cache_config.py index f3535ba..4cb9100 100644 --- a/test/functional/api/cas/cache_config.py +++ b/test/functional/api/cas/cache_config.py @@ -57,6 +57,12 @@ class CacheMode(Enum): m for m in CacheMode if all(map(lambda t: t in CacheMode.get_traits(m), flags)) ] + @staticmethod + def with_any_trait(flags: CacheModeTrait): + return [ + m for m in CacheMode if any(map(lambda t: t in CacheMode.get_traits(m), flags)) + ] + class SeqCutOffPolicy(Enum): full = 0