From 96124ca87a61d71ab6ad60787fbd132e35302730 Mon Sep 17 00:00:00 2001 From: Jan Musial Date: Tue, 31 Aug 2021 12:14:43 +0200 Subject: [PATCH] Enable Size comparisons in pyocf Signed-off-by: Jan Musial --- tests/functional/pyocf/utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/pyocf/utils.py b/tests/functional/pyocf/utils.py index 0c86ae1..3e00dbc 100644 --- a/tests/functional/pyocf/utils.py +++ b/tests/functional/pyocf/utils.py @@ -82,6 +82,24 @@ class Size: else: self.bytes = int(b) + def __lt__(self, other): + return int(self) < int(other) + + def __le__(self, other): + return int(self) <= int(other) + + def __eq__(self, other): + return int(self) == int(other) + + def __ne__(self, other): + return int(self) != int(other) + + def __gt__(self, other): + return int(self) > int(other) + + def __ge__(self, other): + return int(self) >= int(other) + def __int__(self): return self.bytes