Skip to content

Commit cf3ca3b

Browse files
Add tests for --show-all flag
1 parent 3452270 commit cf3ca3b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

cloudsmith_cli/cli/tests/commands/policy/test_licence.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def test_license_policy_commands(runner, organization, tmp_path):
130130
ls, args=[organization, "--show-all"], catch_exceptions=False
131131
)
132132
assert "Getting license policies ... OK" in result.output
133-
assert "Results: 1 license policy" in result.output
133+
134+
assert "Results: " in result.output and " license policy" in result.output
134135

135136
# Change the values in the config file
136137
policy_config_file_path = create_license_policy_config_file(

cloudsmith_cli/cli/tests/commands/policy/test_vulnerability.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,12 @@ def test_vulnerability_policy_commands(runner, organization, tmp_path):
126126
result = runner.invoke(ls, args=[organization], catch_exceptions=False)
127127
assert "Getting vulnerability policies ... OK" in result.output
128128
assert_output_matches_policy_config(result.output, policy_config_file_path)
129-
130129
# List policies with --show-all flag
131130
result = runner.invoke(
132131
ls, args=[organization, "--show-all"], catch_exceptions=False
133132
)
134133
assert "Getting vulnerability policies ... OK" in result.output
135-
assert "Results: 1 vulnerability policy" in result.output
134+
assert "Results: " in result.output and " vulnerability policy" in result.output
136135

137136
# Change the values in the config file
138137
policy_config_file_path = create_vulnerability_policy_config_file(

cloudsmith_cli/cli/tests/commands/test_repos.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def test_repos_commands(runner, organization, tmp_path):
122122
# List repositories with --show-all flag
123123
result = runner.invoke(get, [organization, "--show-all"], catch_exceptions=False)
124124
assert "Getting list of repositories ... OK" in result.output
125-
assert "Results: 1 repository retrieved" in result.output
125+
# A static number cannot be used here because we are performing this test in cloudsmith org which is active.
126+
assert "Results: " in result.output and " repository" in result.output
126127

127128
# Change the repository description in the repo config file.
128129
repository_description = random_str()

0 commit comments

Comments
 (0)