@@ -113,7 +113,9 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
113
113
assert (
114
114
"Creating "
115
115
+ policy_name
116
- + " vulnerability policy for the cloudsmith namespace ...OK"
116
+ + " vulnerability policy for the "
117
+ + organization
118
+ + " namespace ...OK"
117
119
in result .output
118
120
)
119
121
slug_perm = assert_output_matches_policy_config (
@@ -124,6 +126,12 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
124
126
result = runner .invoke (ls , args = [organization ], catch_exceptions = False )
125
127
assert "Getting vulnerability policies ... OK" in result .output
126
128
assert_output_matches_policy_config (result .output , policy_config_file_path )
129
+ # List policies with --show-all flag
130
+ result = runner .invoke (
131
+ ls , args = [organization , "--show-all" ], catch_exceptions = False
132
+ )
133
+ assert "Getting vulnerability policies ... OK" in result .output
134
+ assert "Results: " in result .output and " vulnerability policy" in result .output
127
135
128
136
# Change the values in the config file
129
137
policy_config_file_path = create_vulnerability_policy_config_file (
@@ -145,7 +153,9 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
145
153
assert (
146
154
"Updating "
147
155
+ slug_perm
148
- + " vulnerability policy in the cloudsmith namespace ...OK"
156
+ + " vulnerability policy in the "
157
+ + organization
158
+ + " namespace ...OK"
149
159
in result .output
150
160
)
151
161
assert_output_matches_policy_config (result .output , policy_config_file_path )
@@ -157,7 +167,9 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
157
167
assert (
158
168
"Are you absolutely certain you want to delete the "
159
169
+ slug_perm
160
- + " vulnerability policy from the cloudsmith namespace? [y/N]: N"
170
+ + " vulnerability policy from the "
171
+ + organization
172
+ + " namespace? [y/N]: N"
161
173
in result .output
162
174
)
163
175
assert "OK, phew! Close call. :-)" in result .output
@@ -169,10 +181,12 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
169
181
assert (
170
182
"Are you absolutely certain you want to delete the "
171
183
+ slug_perm
172
- + " vulnerability policy from the cloudsmith namespace? [y/N]: Y"
184
+ + " vulnerability policy from the "
185
+ + organization
186
+ + " namespace? [y/N]: Y"
173
187
in result .output
174
188
)
175
189
assert (
176
- "Deleting " + slug_perm + " from the cloudsmith namespace ... OK"
190
+ "Deleting " + slug_perm + " from the " + organization + " namespace ... OK"
177
191
in result .output
178
192
)
0 commit comments