aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranushadasari <danush10@in.ibm.com>2019-11-13 13:27:51 +0530
committeranushadasari <danush10@in.ibm.com>2019-11-13 13:28:05 +0530
commit00c64458942602efe5a3b712540b98ac94fb60f4 (patch)
tree1268ed3a437e80584508a794be9ae1c83c9d8809
parentdd0d480978570b4222206bc04edd271c39b88b44 (diff)
change if bad to assert not bad, message
eliminates if statement Issue-ID: VVP-295 Change-Id: Ifa4a6cbaf79bfcab089fe9da4893aac661d70230 Signed-off-by: anushadasari <danush10@in.ibm.com>
-rw-r--r--ice_validator/tests/test_vm_type_case.py18
1 files changed, 7 insertions, 11 deletions
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