From aeda2fb6a55daa47b9a047c56be5ed9db5bd2894 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Tue, 13 Mar 2018 11:39:35 -0500 Subject: 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 --- openstackclient/tests/functional/common/test_extension.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openstackclient/tests/functional') 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') -- cgit v1.2.1