From: anushadasari Date: Wed, 13 Nov 2019 07:57:51 +0000 (+0530) Subject: change if bad to assert not bad, message X-Git-Tag: 6.0.0~18^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vvp%2Fvalidation-scripts.git;a=commitdiff_plain;h=refs%2Fchanges%2F44%2F98344%2F1 change if bad to assert not bad, message eliminates if statement Issue-ID: VVP-295 Change-Id: Ifa4a6cbaf79bfcab089fe9da4893aac661d70230 Signed-off-by: anushadasari --- diff --git a/ice_validator/tests/test_vm_type_case.py b/ice_validator/tests/test_vm_type_case.py index db4646c..6919404 100644 --- a/ice_validator/tests/test_vm_type_case.py +++ b/ice_validator/tests/test_vm_type_case.py @@ -111,14 +111,10 @@ def test_vm_type_case(yaml_file): param = param[0] if isinstance(param, str) and case_mismatch(vm_type, param): bad[(rid, vm_type)].append((prop, param)) - if bad: - raise AssertionError( - "vm-type/parameter case mis-match %s" - % ( - "; ".join( - "resource: %s vm-type: %s %s" - % (k[0], k[1], ", ".join("%s: %s" % i for i in v)) - for k, v in bad.items() - ) - ) - ) + + msg = 'vm-type/parameter case mis-match %s' \ + % '; '.join('resource: %s vm-type: %s %s' % (k[0], k[1], + ', '.join('%s: %s' % i for i in v)) for (k, v) in + bad.items()) + + assert not bad, msg