Stop using functools.total_ordering

It is only available since 2.7, and only saves us from defining three
trivial methods.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-05-25 13:27:57 +02:00
parent 9ab9aaf8d9
commit b55f8abd29
1 changed files with 9 additions and 2 deletions

View File

@ -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.