Fix unit test failue with cliff>=3.5.0

This change fixes the failure in unit tests, which was caused by
the different exception raised by HelpExit since cliff 3.5.0[1].

[1] 7fdd7cb4c50a33233a7052fc345221cc7b935889

Story: 2010022
Task: 45401

Change-Id: I07e51211befa0296d15e6dbdd726c7a989678183
(cherry picked from commit ca596f05b1)
(cherry picked from commit 0f87087b6f)
(cherry picked from commit afee180ee8)
This commit is contained in:
Takashi Kajinami
2021-12-21 21:12:43 +09:00
committed by Douglas Mendizábal
parent 45af88b4bd
commit ebf2ee6317

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
from testtools import testcase
from barbicanclient import barbican as barb
from barbicanclient.barbican import Barbican
@@ -49,10 +48,8 @@ class WhenTestingBarbicanCLI(test_client.BaseEntityResource):
self.assertIsNotNone(client)
return client
@testcase.skip("https://storyboard.openstack.org/#!/story/2010022")
def test_should_show_usage_with_help_flag(self):
e = self.assertRaises(SystemExit, self.barbican.run, ['-h'])
self.assertEqual(0, e.code)
self.assertRaises(SystemExit, self.barbican.run, ['-h'])
self.assertIn('usage', self.captured_stdout.getvalue())
def test_should_show_usage_with_no_args(self):