diff options
| author | Matt Turner <mattst88@gentoo.org> | 2021-01-02 19:52:59 -0500 |
|---|---|---|
| committer | Matt Turner <mattst88@gentoo.org> | 2021-01-02 19:52:59 -0500 |
| commit | da5a8798054f23fc16f8c59644e4ac03c4d4980d (patch) | |
| tree | cddf4d053ce8d0c4e78620f8c434677805afc3eb | |
| parent | 9f01c8b098484866974407bb74680debf0d64e4f (diff) | |
| download | gentoolkit-da5a8798054f23fc16f8c59644e4ac03c4d4980d.tar.gz | |
gentoolkit: Remove gentoolkit.test.cmp
Signed-off-by: Matt Turner <mattst88@gentoo.org>
| -rw-r--r-- | pym/gentoolkit/test/__init__.py | 23 | ||||
| -rw-r--r-- | pym/gentoolkit/test/test_atom.py | 15 | ||||
| -rw-r--r-- | pym/gentoolkit/test/test_cpv.py | 15 |
3 files changed, 0 insertions, 53 deletions
diff --git a/pym/gentoolkit/test/__init__.py b/pym/gentoolkit/test/__init__.py index 9e41686..e69de29 100644 --- a/pym/gentoolkit/test/__init__.py +++ b/pym/gentoolkit/test/__init__.py @@ -1,23 +0,0 @@ -#!/usr/bin/python -# Copyright 2009 Gentoo Foundation -# -# Distributed under the terms of the GNU General Public License v2 - -__all__ = ['cmp'] - -# py3k doesn't have cmp emulate it in order to keep testing cmp -# in python-2.x -#XXX: not sure if this is the best place for this -try: - cmp = cmp -except NameError: - def cmp(a, b): - if a == b: - return 0 - elif a < b: - return -1 - elif a > b: - return 1 - # just to be safe, __lt__/ __gt__ above should have thrown - # something like this already - raise TypeError("Comparison between unorderable types") diff --git a/pym/gentoolkit/test/test_atom.py b/pym/gentoolkit/test/test_atom.py index 664bf40..6df52a9 100644 --- a/pym/gentoolkit/test/test_atom.py +++ b/pym/gentoolkit/test/test_atom.py @@ -7,7 +7,6 @@ import unittest from gentoolkit.atom import Atom from gentoolkit.cpv import CPV -from gentoolkit.test import cmp """Atom test suite (verbatim) from pkgcore.""" @@ -17,26 +16,12 @@ class TestGentoolkitAtom(unittest.TestCase): # logic bugs hidden behind short circuiting comparisons for metadata # is why we test the comparison *both* ways. self.assertEqual(o1, o2) - c = cmp(o1, o2) - self.assertEqual(c, 0, - msg="checking cmp for %r, %r, aren't equal: got %i" % (o1, o2, c)) self.assertEqual(o2, o1) - c = cmp(o2, o1) - self.assertEqual(c, 0, - msg="checking cmp for %r, %r,aren't equal: got %i" % (o2, o1, c)) def assertNotEqual2(self, o1, o2): # is why we test the comparison *both* ways. self.assertNotEqual(o1, o2) - c = cmp(o1, o2) - self.assertNotEqual(c, 0, - msg="checking cmp for %r, %r, not supposed to be equal, got %i" - % (o1, o2, c)) self.assertNotEqual(o2, o1) - c = cmp(o2, o1) - self.assertNotEqual(c, 0, - msg="checking cmp for %r, %r, not supposed to be equal, got %i" - % (o2, o1, c)) def test_comparison(self): self.assertEqual2(Atom('cat/pkg'), Atom('cat/pkg')) diff --git a/pym/gentoolkit/test/test_cpv.py b/pym/gentoolkit/test/test_cpv.py index 3817e9f..92ffba5 100644 --- a/pym/gentoolkit/test/test_cpv.py +++ b/pym/gentoolkit/test/test_cpv.py @@ -7,7 +7,6 @@ import unittest from gentoolkit.cpv import CPV, compare_strs -from gentoolkit.test import cmp class TestGentoolkitCPV(unittest.TestCase): @@ -15,26 +14,12 @@ class TestGentoolkitCPV(unittest.TestCase): # logic bugs hidden behind short circuiting comparisons for metadata # is why we test the comparison *both* ways. self.assertEqual(o1, o2) - c = cmp(o1, o2) - self.assertEqual(c, 0, - msg="checking cmp for %r, %r, aren't equal: got %i" % (o1, o2, c)) self.assertEqual(o2, o1) - c = cmp(o2, o1) - self.assertEqual(c, 0, - msg="checking cmp for %r, %r,aren't equal: got %i" % (o2, o1, c)) def assertNotEqual2(self, o1, o2): # is why we test the comparison *both* ways. self.assertNotEqual(o1, o2) - c = cmp(o1, o2) - self.assertNotEqual(c, 0, - msg="checking cmp for %r, %r, not supposed to be equal, got %i" - % (o1, o2, c)) self.assertNotEqual(o2, o1) - c = cmp(o2, o1) - self.assertNotEqual(c, 0, - msg="checking cmp for %r, %r, not supposed to be equal, got %i" - % (o2, o1, c)) def test_comparison(self): self.assertEqual2(CPV('pkg'), CPV('pkg')) |
