summaryrefslogtreecommitdiff
path: root/openstackclient/tests/volume
diff options
context:
space:
mode:
authorSteve Martinelli <s.martinelli@gmail.com>2016-07-07 22:41:07 -0400
committerSteve Martinelli <s.martinelli@gmail.com>2016-07-07 22:54:23 -0400
commit9f09d8c5d43141b683dd6b5258fa94799571a843 (patch)
tree27e3040e53028415230cbbdad7f119c99cdf0dcc /openstackclient/tests/volume
parentffb232a90e8b5c8358e017bf057a045a2d59bbfc (diff)
downloadpython-openstackclient-9f09d8c5d43141b683dd6b5258fa94799571a843.tar.gz
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
Diffstat (limited to 'openstackclient/tests/volume')
-rw-r--r--openstackclient/tests/volume/test_find_resource.py13
1 files changed, 6 insertions, 7 deletions
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')