Update error messages in sanity tests
Update error messages throughout sanity tests
to use the same (or similar) format of error message.
Change-Id: I4db0517a5b264151ddaa6ea2c2a04d37e139944e
Related-PROD: #PROD-32415
diff --git a/test_set/cvp-sanity/tests/test_salt_master.py b/test_set/cvp-sanity/tests/test_salt_master.py
index f2d7f1a..35ebcb7 100644
--- a/test_set/cvp-sanity/tests/test_salt_master.py
+++ b/test_set/cvp-sanity/tests/test_salt_master.py
@@ -9,8 +9,10 @@
tgt='salt:master',
param='cd /srv/salt/reclass/classes/cluster/; git status',
expr_form='pillar', check_status=True)
- assert 'nothing to commit' in git_status.values()[0], 'Git status showed' \
- ' some unmerged changes {}'''.format(git_status.values()[0])
+ assert 'nothing to commit' in git_status.values()[0], (
+ "Git status shows some unmerged changes:\n{}".format(
+ git_status.values()[0])
+ )
@pytest.mark.smoke
@@ -21,8 +23,7 @@
expr_form='pillar', check_status=True)
result = reclass[reclass.keys()[0]][-1]
- assert result == '0', 'Reclass is broken' \
- '\n {}'.format(reclass)
+ assert result == '0', 'Reclass is broken:\n{}'.format(reclass)
@pytest.mark.smoke
@@ -43,5 +44,7 @@
' reclass-salt --top output'
reclass_nodes = sorted(json.loads(reclass_nodes.strip("}")).keys())
salt_nodes = sorted([x for xs in json.loads(salt).values() for x in xs])
- assert salt_nodes == reclass_nodes, 'Mismatch between registered salt nodes (left) ' \
- 'and defined reclass nodes (right)'
+ assert salt_nodes == reclass_nodes, (
+ "Mismatch between registered salt nodes (left) and node defined in "
+ "reclass (right)."
+ )