aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-11-20 18:12:21 +0100
committerKevin Wolf <kwolf@redhat.com>2018-11-21 10:30:05 +0100
commitfa1cfb40262b8a60e0f93b70491660f242638f81 (patch)
treebd02b41ddccad19e4284b07df4b911d742fb2e2f /tests
parentd8336c6b286d9715bfe29a0e0b415dfd7891f671 (diff)
downloadqemu-fa1cfb40262b8a60e0f93b70491660f242638f81.zip
qemu-fa1cfb40262b8a60e0f93b70491660f242638f81.tar.gz
qemu-fa1cfb40262b8a60e0f93b70491660f242638f81.tar.bz2
iotests: Replace assertEquals() with assertEqual()
TestCase.assertEquals() is deprecated since Python 2.7. Recent Python versions print a warning when the function is called, which makes test cases fail. Replace it with the preferred spelling assertEqual(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/0416
-rwxr-xr-xtests/qemu-iotests/1184
-rw-r--r--tests/qemu-iotests/iotests.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 3615011..26bf170 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -469,7 +469,7 @@ new_state = "1"
self.assert_qmp(event, 'data/id', 'drive0')
event = self.vm.get_qmp_event(wait=True)
- self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
+ self.assertEqual(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'read')
result = self.vm.qmp('query-block-jobs')
@@ -494,7 +494,7 @@ new_state = "1"
self.assert_qmp(event, 'data/id', 'drive0')
event = self.vm.get_qmp_event(wait=True)
- self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
+ self.assertEqual(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'read')
result = self.vm.qmp('query-block-jobs')
@@ -625,7 +625,7 @@ new_state = "1"
self.assert_qmp(result, 'return', {})
event = self.vm.event_wait(name='BLOCK_JOB_ERROR')
- self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
+ self.assertEqual(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'write')
result = self.vm.qmp('query-block-jobs')
diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
index c4f4c21..603e10e 100755
--- a/tests/qemu-iotests/118
+++ b/tests/qemu-iotests/118
@@ -261,7 +261,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
result = self.vm.qmp('blockdev-close-tray', id=self.device_name)
# Should be a no-op
self.assert_qmp(result, 'return', {})
- self.assertEquals(self.vm.get_qmp_events(wait=False), [])
+ self.assertEqual(self.vm.get_qmp_events(wait=False), [])
def test_remove_on_closed(self):
if not self.has_real_tray:
@@ -448,7 +448,7 @@ class TestChangeReadOnly(ChangeBaseClass):
read_only_mode='retain')
self.assert_qmp(result, 'error/class', 'GenericError')
- self.assertEquals(self.vm.get_qmp_events(wait=False), [])
+ self.assertEqual(self.vm.get_qmp_events(wait=False), [])
result = self.vm.qmp('query-block')
self.assert_qmp(result, 'return[0]/inserted/ro', False)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 27bb2b6..d537538 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -581,7 +581,7 @@ class QMPTestCase(unittest.TestCase):
def wait_ready_and_cancel(self, drive='drive0'):
self.wait_ready(drive=drive)
event = self.cancel_and_wait(drive=drive)
- self.assertEquals(event['event'], 'BLOCK_JOB_COMPLETED')
+ self.assertEqual(event['event'], 'BLOCK_JOB_COMPLETED')
self.assert_qmp(event, 'data/type', 'mirror')
self.assert_qmp(event, 'data/offset', event['data']['len'])