qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] iotests.py: improve verify_image_format hel


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 1/3] iotests.py: improve verify_image_format helper
Date: Tue, 3 Apr 2018 15:54:58 +0200
User-agent: Mutt/1.9.1 (2017-09-22)

Am 30.03.2018 um 17:16 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Add an assert (we don't want set both arguments) and remove
> duplication.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  tests/qemu-iotests/iotests.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index b5d7945..83c454d 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -532,9 +532,9 @@ def notrun(reason):
>      sys.exit(0)
>  
>  def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
> -    if supported_fmts and (imgfmt not in supported_fmts):
> -        notrun('not suitable for this image format: %s' % imgfmt)
> -    if unsupported_fmts and (imgfmt in unsupported_fmts):
> +    assert not (supported_fmts and unsupported_fmts)
> +    not_sup = supported_fmts and (imgfmt not in supported_fmts)
> +    if not_sup or (imgfmt in unsupported_fmts):
>          notrun('not suitable for this image format: %s' % imgfmt)

Before the change, we accepted None for both parameters. Now None is
still accepted for supported_fmts, but not for unsupported_fmts any
more.

I don't think we actually make use of None for either, so I don't really
mind whether we allow it or not, but we should be consistent between
both parameters.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]