summaryrefslogtreecommitdiffstats
path: root/src/tests/pysss_murmur-test.py
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-11-10 17:32:27 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-01-13 14:40:37 +0100
commit2f9b4cc993a259d408afab2cf0fec85e515424cd (patch)
tree1f86b92fc4f1574e914717d92c04e3c4fef3ef42 /src/tests/pysss_murmur-test.py
parentc42bd764452ecda95b7d8d3ce027c70b4ad5982c (diff)
downloadsssd-2f9b4cc993a259d408afab2cf0fec85e515424cd.tar.gz
sssd-2f9b4cc993a259d408afab2cf0fec85e515424cd.tar.xz
sssd-2f9b4cc993a259d408afab2cf0fec85e515424cd.zip
tests: use unittest.TestCase.assertCountEqual if possible
We used to defined a compat method for assertItemsEqual that existed on Python 2.7, but not on old Python 2.x. As an effect, we used our compat code even if assertCountEqual was available from standard library. The recent Python 3.x versions renamed assertItemsEqual to assertCountEqual. Therefore we should use the modern version which is in the standard library over a compat version provided by ourselves. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Petr Cech <pcech@redhat.com>
Diffstat (limited to 'src/tests/pysss_murmur-test.py')
-rwxr-xr-xsrc/tests/pysss_murmur-test.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/tests/pysss_murmur-test.py b/src/tests/pysss_murmur-test.py
index faa8bb2d..d21450a2 100755
--- a/src/tests/pysss_murmur-test.py
+++ b/src/tests/pysss_murmur-test.py
@@ -28,19 +28,6 @@ import errno
srcdir = os.getenv('builddir') or "."
MODPATH = srcdir + "/.libs" #FIXME - is there a way to get this from libtool?
-def compat_assertItemsEqual(this, expected_seq, actual_seq, msg=None):
- return this.assertEqual(sorted(expected_seq), sorted(actual_seq))
-
-def compat_assertIsInstance(this, obj, cls, msg=None):
- return this.assertTrue(isinstance(obj, cls))
-
-# add compat methods for old unittest.TestCase versions
-# (python < 2.7, RHEL5 for instance)
-if not hasattr(unittest.TestCase, "assertItemsEqual"):
- setattr(unittest.TestCase, "assertItemsEqual", compat_assertItemsEqual)
-if not hasattr(unittest.TestCase, "assertIsInstance"):
- setattr(unittest.TestCase, "assertIsInstance", compat_assertIsInstance)
-
class PySssMurmurImport(unittest.TestCase):
def setUp(self):
" Make sure we load the in-tree module "