Correct test_get_usage_tenant's AttributeError
When show_tenant_usage didn't get the expected result in VALID_WAIT
time(30 secs), we will get "AttributeError: 'TenantUsagesTestJSON'
object has no attribute 'resp'". This is to correct this and make
the error message more understandable.
Change-Id: Ic9e83b7c2cafbb27eed240f4bec15c1dbd5694a5
Closes-Bug: #1586319
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index 8986db8..a4ed8dc 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -59,7 +59,9 @@
return True
except e.InvalidHTTPResponseBody:
return False
- test.call_until_true(is_valid, duration, 1)
+ self.assertEqual(test.call_until_true(is_valid, duration, 1), True,
+ "%s not return valid response in %s secs" % (
+ func.__name__, duration))
return self.resp
@test.idempotent_id('062c8ae9-9912-4249-8b51-e38d664e926e')