diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2018-03-13 11:39:35 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2018-03-13 11:52:44 -0500 |
| commit | aeda2fb6a55daa47b9a047c56be5ed9db5bd2894 (patch) | |
| tree | a286ca30079af557c5cfa2338300cfe22eb63af3 /openstackclient/tests/functional/common | |
| parent | 60768081925ebe07b30a5f268efb5d442c7f50dc (diff) | |
| download | python-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
Diffstat (limited to 'openstackclient/tests/functional/common')
| -rw-r--r-- | openstackclient/tests/functional/common/test_extension.py | 9 |
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') |
