[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 7/9] iotests: replace lambda function by lambda
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-block] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility |
Date: |
Wed, 20 Dec 2017 10:08:05 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Dec 19, 2017 at 02:34:23PM -0300, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> tests/qemu-iotests/065 | 4 ++--
> tests/qemu-iotests/139 | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrange <address@hidden>
>
> diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065
> index 72aa9707c7..e95f7f817b 100755
> --- a/tests/qemu-iotests/065
> +++ b/tests/qemu-iotests/065
> @@ -59,7 +59,7 @@ class TestQemuImgInfo(TestImageInfoSpecific):
> :data.index('')]
> for field in data:
> self.assertTrue(re.match('^ {4}[^ ]', field) is not None)
> - data = map(lambda line: line.strip(), data)
> + data = [line.strip() for line in data]
> self.assertEqual(data, self.human_compare)
>
> class TestQMP(TestImageInfoSpecific):
> @@ -80,7 +80,7 @@ class TestQMP(TestImageInfoSpecific):
>
> def test_qmp(self):
> result = self.vm.qmp('query-block')['return']
> - drive = filter(lambda drive: drive['device'] == 'drive0', result)[0]
> + drive = [drive for drive in result if drive['device'] == 'drive0'][0]
> data = drive['inserted']['image']['format-specific']
> self.assertEqual(data['type'], iotests.imgfmt)
> self.assertEqual(data['data'], self.compare)
> diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
> index f8f02808a9..b54c816c16 100644
> --- a/tests/qemu-iotests/139
> +++ b/tests/qemu-iotests/139
> @@ -51,7 +51,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
> # Check whether a BlockDriverState exists
> def checkBlockDriverState(self, node, must_exist = True):
> result = self.vm.qmp('query-named-block-nodes')
> - nodes = filter(lambda x: x['node-name'] == node, result['return'])
> + nodes = [x for x in result['return'] if x['node-name'] == node]
> self.assertLessEqual(len(nodes), 1)
> self.assertEqual(must_exist, len(nodes) == 1)
>
> --
> 2.15.1
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-block] [PATCH 0/9] iotests: python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 4/9] iotests: use octal numbers for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 5/9] iotests: replace xrange() by range() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- Re: [Qemu-block] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility,
Daniel P. Berrange <=
- [Qemu-block] [PATCH 8/9] iotests: replace assertEquals() by assertEqual() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-block] [PATCH 9/9] iotests.py: use io.StringIO with python3, Philippe Mathieu-Daudé, 2017/12/19
- Re: [Qemu-block] [PATCH 0/9] iotests: python3 compatibility, Paolo Bonzini, 2017/12/19