From b55f8abd29486f2437e27e508fec77e68d2fc336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 25 May 2016 13:27:57 +0200 Subject: [PATCH] Stop using functools.total_ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is only available since 2.7, and only saves us from defining three trivial methods. Signed-off-by: Lubomír Sedlář --- tests/test_pkgset_pkgsets.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_pkgset_pkgsets.py b/tests/test_pkgset_pkgsets.py index 6d6f88f6..72e2bdd4 100755 --- a/tests/test_pkgset_pkgsets.py +++ b/tests/test_pkgset_pkgsets.py @@ -6,7 +6,6 @@ import os import sys import unittest import json -import functools import tempfile sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) @@ -32,7 +31,6 @@ class MockPathInfo(object): return os.path.join('rpms', self.get_filename(rpm_info)) -@functools.total_ordering class MockFile(object): def __init__(self, path): if path.startswith('/tmp'): @@ -63,6 +61,15 @@ class MockFile(object): except AttributeError: return self.file_path < other + def __lt__(self, other): + return self <= other and self != other + + def __ge__(self, other): + return not (self <= other) or self == other + + def __gt__(self, other): + return not (self <= other) + class MockFileCache(dict): """Mock for kobo.pkgset.FileCache.