From 9f09d8c5d43141b683dd6b5258fa94799571a843 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 7 Jul 2016 22:41:07 -0400 Subject: Unskip tests caused by bug 1599333 There is now a second .get() call in osc_lib.utils.find_resources. These tests were failing because they only mocked a single access call to .get(). Ensure there are two calls to .get(), with the first one raising an exception. Change-Id: Idd2ad4a27a6db5bee633cc37a1042dbb0a57aa71 Closes-Bug: #1599333 --- openstackclient/tests/volume/test_find_resource.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'openstackclient/tests/volume') diff --git a/openstackclient/tests/volume/test_find_resource.py b/openstackclient/tests/volume/test_find_resource.py index 8f29ec34..982b02f0 100644 --- a/openstackclient/tests/volume/test_find_resource.py +++ b/openstackclient/tests/volume/test_find_resource.py @@ -19,7 +19,6 @@ from cinderclient.v1 import volume_snapshots from cinderclient.v1 import volumes from osc_lib import exceptions from osc_lib import utils -import testtools from openstackclient.tests import utils as test_utils from openstackclient.volume import client # noqa @@ -45,16 +44,16 @@ class TestFindResourceVolumes(test_utils.TestCase): api.client.get = mock.Mock() resp = mock.Mock() body = {"volumes": [{"id": ID, 'display_name': NAME}]} - api.client.get.side_effect = [Exception("Not found"), (resp, body)] + api.client.get.side_effect = [Exception("Not found"), + Exception("Not found"), + (resp, body)] self.manager = volumes.VolumeManager(api) - @testtools.skip("skip until bug 1599333 is fixed") def test_find(self): result = utils.find_resource(self.manager, NAME) self.assertEqual(ID, result.id) self.assertEqual(NAME, result.display_name) - @testtools.skip("skip until bug 1599333 is fixed") def test_not_find(self): self.assertRaises(exceptions.CommandError, utils.find_resource, self.manager, 'GeorgeMartin') @@ -69,16 +68,16 @@ class TestFindResourceVolumeSnapshots(test_utils.TestCase): api.client.get = mock.Mock() resp = mock.Mock() body = {"snapshots": [{"id": ID, 'display_name': NAME}]} - api.client.get.side_effect = [Exception("Not found"), (resp, body)] + api.client.get.side_effect = [Exception("Not found"), + Exception("Not found"), + (resp, body)] self.manager = volume_snapshots.SnapshotManager(api) - @testtools.skip("skip until bug 1599333 is fixed") def test_find(self): result = utils.find_resource(self.manager, NAME) self.assertEqual(ID, result.id) self.assertEqual(NAME, result.display_name) - @testtools.skip("skip until bug 1599333 is fixed") def test_not_find(self): self.assertRaises(exceptions.CommandError, utils.find_resource, self.manager, 'GeorgeMartin') -- cgit v1.2.1