Skip to content

Commit 6251d7d

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Add help commands withouth auth in functional"
2 parents b2ceb58 + 341f075 commit 6251d7d

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

openstackclient/tests/functional/common/test_help.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13+
import os
14+
1315
from openstackclient.tests.functional import base
1416

1517

@@ -71,3 +73,48 @@ def test_networking_commands_help(self):
7173
self.assertIn('List networks', raw_output)
7274
raw_output = self.openstack('network create --help')
7375
self.assertIn('Create new network', raw_output)
76+
77+
def test_commands_help_no_auth(self):
78+
"""Check help commands without auth info."""
79+
# Pop all auth info
80+
auth_info = {key: os.environ.pop(key)
81+
for key in os.environ.keys()
82+
if key.startswith('OS_')}
83+
84+
raw_output = self.openstack('help')
85+
self.assertIn('usage: openstack', raw_output)
86+
raw_output = self.openstack('--help')
87+
self.assertIn('usage: openstack', raw_output)
88+
89+
raw_output = self.openstack('help network list')
90+
self.assertIn('List networks', raw_output)
91+
raw_output = self.openstack('network list --help')
92+
self.assertIn('List networks', raw_output)
93+
94+
raw_output = self.openstack('help volume list')
95+
self.assertIn('List volumes', raw_output)
96+
raw_output = self.openstack('volume list --help')
97+
self.assertIn('List volumes', raw_output)
98+
99+
raw_output = self.openstack('help server list')
100+
self.assertIn('List servers', raw_output)
101+
raw_output = self.openstack('server list --help')
102+
self.assertIn('List servers', raw_output)
103+
104+
raw_output = self.openstack('help user list')
105+
self.assertIn('List users', raw_output)
106+
raw_output = self.openstack('user list --help')
107+
self.assertIn('List users', raw_output)
108+
109+
raw_output = self.openstack('help image list')
110+
self.assertIn('List available images', raw_output)
111+
raw_output = self.openstack('image list --help')
112+
self.assertIn('List available images', raw_output)
113+
114+
raw_output = self.openstack('help container list')
115+
self.assertIn('List containers', raw_output)
116+
raw_output = self.openstack('container list --help')
117+
self.assertIn('List containers', raw_output)
118+
119+
# Restore auth info
120+
os.environ.update(auth_info)

0 commit comments

Comments
 (0)