summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-25 17:57:44 +0000
committerGerrit Code Review <review@openstack.org>2018-07-25 17:57:44 +0000
commit7ae49c5b027deada21a9998cd1c993ef61e52641 (patch)
treee221e7742c30bb8a7ee8a38e2f6f4f3942d16058 /openstackclient/tests
parentcc037e22a6fa0f35b5a9d8c66a357596ad4b2177 (diff)
parent9ece632f96844fd78c2f717f2f6d35e61c3b9ef2 (diff)
downloadpython-openstackclient-7ae49c5b027deada21a9998cd1c993ef61e52641.tar.gz
Merge "Add command to show all service versions"
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/functional/common/test_versions.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/common/test_versions.py b/openstackclient/tests/functional/common/test_versions.py
new file mode 100644
index 00000000..adc74ebc
--- /dev/null
+++ b/openstackclient/tests/functional/common/test_versions.py
@@ -0,0 +1,31 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import json
+
+from openstackclient.tests.functional import base
+
+
+class VersionsTests(base.TestCase):
+ """Functional tests for versions."""
+
+ def test_versions_show(self):
+ # TODO(mordred) Make this better. The trick is knowing what in the
+ # payload to test for.
+ cmd_output = json.loads(self.openstack(
+ 'versions show -f json'
+ ))
+ self.assertIsNotNone(cmd_output)
+ self.assertIn(
+ "Region Name",
+ cmd_output[0],
+ )