From 66d87b896efa26babfae6f348c3b6cda85b5fcac Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Sat, 12 Nov 2016 08:58:43 +0900 Subject: [PATCH] Improve error message on volume tests failure Current error message does not give much clarity about what exactly failed. This commit improve the error message by providing more info like sort_key and expected order in msg along with fetched list. Change-Id: I027ded27c08bf47398323408661f192b002c4bcf --- tempest/api/volume/v2/test_volumes_list.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tempest/api/volume/v2/test_volumes_list.py b/tempest/api/volume/v2/test_volumes_list.py index 771702781b..03996af9f3 100644 --- a/tempest/api/volume/v2/test_volumes_list.py +++ b/tempest/api/volume/v2/test_volumes_list.py @@ -73,9 +73,13 @@ class VolumesV2ListTestJSON(base.BaseVolumeTest): val0 = fetched_volume[0][sort_key] val1 = fetched_volume[1][sort_key] if sort_dir == 'asc': - self.assertLess(val0, val1, "%s < %s" % (val0, val1)) + self.assertLess(val0, val1, + "list is not in asc order with sort_key: %s." + " %s" % (sort_key, fetched_volume)) elif sort_dir == 'desc': - self.assertGreater(val0, val1, "%s > %s" % (val0, val1)) + self.assertGreater(val0, val1, + "list is not in desc order with sort_key: " + "%s. %s" % (sort_key, fetched_volume)) _list_details_with_multiple_params() _list_details_with_multiple_params(sort_dir='desc')