summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2018-03-13 11:39:35 -0500
committerDean Troyer <dtroyer@gmail.com>2018-03-13 11:52:44 -0500
commitaeda2fb6a55daa47b9a047c56be5ed9db5bd2894 (patch)
treea286ca30079af557c5cfa2338300cfe22eb63af3
parent60768081925ebe07b30a5f268efb5d442c7f50dc (diff)
downloadpython-openstackclient-aeda2fb6a55daa47b9a047c56be5ed9db5bd2894.tar.gz
Handle SDK changes
stable/queens allows SDK >=0.9.19 and <=0.11.3. Somewhere in there the return text of an exception changed. Backport portions of Id6de1485bcafb41f238f3e74277094ce64a6acf4 to handle this change, but modify to work with either text form sice both are allowed. Change-Id: Ibfee8e1e2ae4eca763894bbee8747297e0fb350f
-rw-r--r--openstackclient/tests/functional/common/test_extension.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/openstackclient/tests/functional/common/test_extension.py b/openstackclient/tests/functional/common/test_extension.py
index e3a91fe6..3391406d 100644
--- a/openstackclient/tests/functional/common/test_extension.py
+++ b/openstackclient/tests/functional/common/test_extension.py
@@ -105,7 +105,14 @@ class ExtensionTests(base.TestCase):
try:
self.openstack('extension show ' + name)
except tempest_exc.CommandFailed as e:
- self.assertIn('ResourceNotFound', str(e))
+ # NOTE(dtroyer): We have to test for both strings because the
+ # change in the SDK between 0.9.19 and 0.11.x
+ # spans our allowed range in stable/queens.
+ not_found = (
+ 'ResourceNotFound' in str(e) or
+ 'No Extension found for' in str(e)
+ )
+ self.assertTrue(not_found)
self.assertIn(name, str(e))
else:
self.fail('CommandFailed should be raised')