summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2016-10-14 14:01:42 -0500
committerDean Troyer <dtroyer@gmail.com>2017-03-27 12:31:42 -0500
commit709eac73fbf0691d8012052773eec73006adf704 (patch)
tree85c1f2d9cf01b320022dee0e7b1997b9d9efeea7 /openstackclient/tests/functional
parentc3fee25a0728ec56453845546dec6f5dd317e81d (diff)
downloadpython-openstackclient-709eac73fbf0691d8012052773eec73006adf704.tar.gz
Fix volume transfers request commands
* Fix volume transfer request accept to actually not crash when trying to call Volume API. * Fix volume transfer request accept syntax to have only one positional argument, which is the ID of the resource in the command * Change the output column order in volume transfer request list to have ID followed by Name then the remaining columns. Closes-bug: 1633582 Change-Id: I5cc005f039d171cc70859f60e7fe649b09ead229
Diffstat (limited to 'openstackclient/tests/functional')
-rw-r--r--openstackclient/tests/functional/volume/v1/test_transfer_request.py12
-rw-r--r--openstackclient/tests/functional/volume/v2/test_transfer_request.py12
2 files changed, 14 insertions, 10 deletions
diff --git a/openstackclient/tests/functional/volume/v1/test_transfer_request.py b/openstackclient/tests/functional/volume/v1/test_transfer_request.py
index e03cd717..3fe11913 100644
--- a/openstackclient/tests/functional/volume/v1/test_transfer_request.py
+++ b/openstackclient/tests/functional/volume/v1/test_transfer_request.py
@@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import json
import uuid
from openstackclient.tests.functional.volume.v1 import common
@@ -67,11 +68,12 @@ class TransferRequestTests(common.BaseVolumeTests):
self.assertNotEqual('', auth_key)
# accept the volume transfer request
- opts = self.get_opts(self.FIELDS)
- raw_output = self.openstack(
- 'volume transfer request accept ' + name +
- ' ' + auth_key + opts)
- self.assertEqual(name + '\n', raw_output)
+ json_output = json.loads(self.openstack(
+ 'volume transfer request accept -f json ' +
+ name + ' ' +
+ '--auth-key ' + auth_key
+ ))
+ self.assertEqual(name, json_output.get('name'))
# the volume transfer will be removed by default after accepted
# so just need to delete the volume here
diff --git a/openstackclient/tests/functional/volume/v2/test_transfer_request.py b/openstackclient/tests/functional/volume/v2/test_transfer_request.py
index 1791f8ac..99d91ac0 100644
--- a/openstackclient/tests/functional/volume/v2/test_transfer_request.py
+++ b/openstackclient/tests/functional/volume/v2/test_transfer_request.py
@@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import json
import uuid
from openstackclient.tests.functional.volume.v2 import common
@@ -67,11 +68,12 @@ class TransferRequestTests(common.BaseVolumeTests):
self.assertNotEqual('', auth_key)
# accept the volume transfer request
- opts = self.get_opts(self.FIELDS)
- raw_output = self.openstack(
- 'volume transfer request accept ' + name +
- ' ' + auth_key + opts)
- self.assertEqual(name + '\n', raw_output)
+ json_output = json.loads(self.openstack(
+ 'volume transfer request accept -f json ' +
+ name + ' ' +
+ '--auth-key ' + auth_key
+ ))
+ self.assertEqual(name, json_output.get('name'))
# the volume transfer will be removed by default after accepted
# so just need to delete the volume here