[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operato
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility |
Date: |
Tue, 19 Dec 2017 14:34:22 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/qemu-iotests/093 | 2 +-
tests/qemu-iotests/096 | 4 ++--
tests/qemu-iotests/136 | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index 5c36a5fb4d..28b1d021ca 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -237,7 +237,7 @@ class ThrottleTestGroupNames(iotests.QMPTestCase):
if name:
self.assertEqual(info["group"], name)
else:
- self.assertFalse(info.has_key('group'))
+ self.assertFalse('group' in info)
return
raise Exception("No group information found for '%s'" % device)
diff --git a/tests/qemu-iotests/096 b/tests/qemu-iotests/096
index aeeb3753cf..a69439602d 100644
--- a/tests/qemu-iotests/096
+++ b/tests/qemu-iotests/096
@@ -53,9 +53,9 @@ class TestLiveSnapshot(iotests.QMPTestCase):
self.assertEqual(r['iops'], self.iops)
self.assertEqual(r['iops_size'], self.iops_size)
else:
- self.assertFalse(r.has_key('group'))
+ self.assertFalse('group' in r)
self.assertEqual(r['iops'], 0)
- self.assertFalse(r.has_key('iops_size'))
+ self.assertFalse('iops_size' in r)
def testSnapshot(self):
self.checkConfig('base')
diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136
index 88b97ea7c6..a154d8ef9d 100644
--- a/tests/qemu-iotests/136
+++ b/tests/qemu-iotests/136
@@ -203,7 +203,7 @@ sector = "%d"
if (self.accounted_ops(read = True, write = True, flush = True) != 0):
self.assertLess(0, stats['idle_time_ns'])
else:
- self.assertFalse(stats.has_key('idle_time_ns'))
+ self.assertFalse('idle_time_ns' in stats)
# This test does not alter these, so they must be all 0
self.assertEqual(0, stats['rd_merged'])
--
2.15.1
- [Qemu-devel] [PATCH 1/9] qemu.py: replace iteritems() by items() for python3 compatibility, (continued)
- [Qemu-devel] [PATCH 1/9] qemu.py: replace iteritems() by items() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 4/9] iotests: use octal numbers for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 5/9] iotests: replace xrange() by range() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 8/9] iotests: replace assertEquals() by assertEqual() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 9/9] iotests.py: use io.StringIO with python3, Philippe Mathieu-Daudé, 2017/12/19
- Re: [Qemu-devel] [PATCH 0/9] iotests: python3 compatibility, Paolo Bonzini, 2017/12/19