Remove usage of unittest2 on Python 3

It was needed to provide assertItemsEqual method. Starting with Python
3.2, there's assertCountEqual that does the same thing. Six provides a
helper that will dispatch to the existing method. With this change,
unittest 2 is only needed on Python 2.6 to backport the method.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-10-04 14:45:03 +02:00
parent 43fb06e00f
commit 2f54745715
32 changed files with 2682 additions and 1923 deletions

View file

@ -11,6 +11,7 @@ except ImportError:
import tempfile
import shutil
import subprocess
import six
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
@ -224,7 +225,7 @@ class TestGetVariantData(unittest.TestCase):
}
}
result = util.get_variant_data(conf, 'foo', mock.Mock(uid='Client'))
self.assertItemsEqual(result, [1, 2, 3])
six.assertCountEqual(self, result, [1, 2, 3])
def test_not_matching_arch(self):
conf = {
@ -233,11 +234,11 @@ class TestGetVariantData(unittest.TestCase):
}
}
result = util.get_variant_data(conf, 'foo', mock.Mock(uid='Server'))
self.assertItemsEqual(result, [])
self.assertEqual(result, [])
def test_handle_missing_config(self):
result = util.get_variant_data({}, 'foo', mock.Mock(uid='Client'))
self.assertItemsEqual(result, [])
self.assertEqual(result, [])
def test_get_save_pattern(self):
conf = {