[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 02/13] iotests: Replace assertEquals() with assertEqu
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 02/13] iotests: Replace assertEquals() with assertEqual() |
Date: |
Thu, 22 Nov 2018 17:54:06 +0100 |
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 <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/qemu-iotests/041 | 6 +++---
tests/qemu-iotests/118 | 4 ++--
tests/qemu-iotests/iotests.py | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 3615011d98..26bf1701eb 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 c4f4c213ca..603e10e8a2 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 27bb2b600c..d537538ba0 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'])
--
2.19.1
- [Qemu-block] [PULL 00/13] Block layer patches, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 01/13] iotests: Replace time.clock() with Timeout, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 02/13] iotests: Replace assertEquals() with assertEqual(),
Kevin Wolf <=
- [Qemu-block] [PULL 03/13] iotests: Skip 233 if certtool not installed, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 04/13] qemu-img: Fix typo, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 05/13] qemu-img: Fix leak, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 06/13] scsi-disk: Fix crash if underlying host file or disk returns error, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 07/13] block: Fix update of BDRV_O_AUTO_RDONLY in update_flags_from_options(), Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 08/13] iotests: fix nbd test 233 to work correctly with raw images, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 09/13] nvme: call blk_drain in NVMe reset code to avoid lockups, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 10/13] nvme: fix out-of-bounds access to the CMB, Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 11/13] Revert "nvme: fix oob access issue(CVE-2018-16847)", Kevin Wolf, 2018/11/22
- [Qemu-block] [PULL 12/13] nvme: fix bug with PCI IRQ pins on teardown, Kevin Wolf, 2018/11/22