diff options
author | Pranav <prprakas@redhat.com> | 2020-05-26 13:48:44 +0530 |
---|---|---|
committer | Bala Konda Reddy M <bala12352@gmail.com> | 2020-05-27 04:38:47 +0000 |
commit | 8516fc05bac6b9c00ce9d4c605049509c837b466 (patch) | |
tree | 31cfb81ddd08f96e5bfc16189ec9061b94cb8c91 /tests/functional/arbiter/test_self_heal_symbolic_links.py | |
parent | 14018d9433d254912a280222db6fc3306a28a30e (diff) |
[TestFix] Fix assertItemsEqual issue with python3
Issue:
In python3 assertItemsEqual is no longer supported and is replaced with assertCountEqual (Refer [1]).
Because of this issue, few arbiter tests are failing.
[1] https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertItemsEqual
Fix:
The replacement assertCountEqual is not supported in python2. So the fix is to replace assertItemsEqual
with assertEqual(sorted(expected), sorted(actual))
Change-Id: Ic1d599fa31f85a8a41598b6c245056a6ff01e000
Signed-off-by: Pranav <prprakas@redhat.com>
Diffstat (limited to 'tests/functional/arbiter/test_self_heal_symbolic_links.py')
-rw-r--r-- | tests/functional/arbiter/test_self_heal_symbolic_links.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/functional/arbiter/test_self_heal_symbolic_links.py b/tests/functional/arbiter/test_self_heal_symbolic_links.py index 6907f8805..ea96d4545 100644 --- a/tests/functional/arbiter/test_self_heal_symbolic_links.py +++ b/tests/functional/arbiter/test_self_heal_symbolic_links.py @@ -196,9 +196,10 @@ class TestSelfHeal(GlusterBaseClass): # Checking arequals before bringing bricks offline # and after bringing bricks offline - self.assertItemsEqual(result_before_offline, result_after_offline, - 'Checksums before and ' - 'after bringing bricks online are not equal') + self.assertEqual(sorted(result_before_offline), + sorted(result_after_offline), + 'Checksums before and after bringing bricks ' + 'online are not equal') g.log.info('Checksums before and after bringing bricks online ' 'are equal') @@ -323,8 +324,9 @@ class TestSelfHeal(GlusterBaseClass): # Checking arequals before bringing bricks online # and after bringing bricks online - self.assertItemsEqual(result_before_online, result_after_online, - 'Checksums before and ' - 'after bringing bricks online are not equal') + self.assertEqual(sorted(result_before_online), + sorted(result_after_online), + 'Checksums before and after bringing bricks ' + 'online are not equal') g.log.info('Checksums before and after bringing bricks online ' 'are equal') |