Skip to content

Commit

Permalink
add try to assert block to inspect error
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusdc committed Sep 17, 2024
1 parent c211fa6 commit 1f392e8
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tests/tests_unit/test_cli_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,26 @@ def test_cli_validate_from_env():
["validate", "--config", tmp_file.resolve()],
env={"NEBARI_SECRET__amazon_web_services__kubernetes_version": "1.20"},
)

assert 0 == valid_result.exit_code
assert not valid_result.exception
assert "Successfully validated configuration" in valid_result.stdout
try:
assert 0 == valid_result.exit_code
assert not valid_result.exception
assert "Successfully validated configuration" in valid_result.stdout
except AssertionError:
print(valid_result.stdout)
raise

invalid_result = runner.invoke(
app,
["validate", "--config", tmp_file.resolve()],
env={"NEBARI_SECRET__amazon_web_services__kubernetes_version": "1.0"},
)

assert 1 == invalid_result.exit_code
assert invalid_result.exception
assert "Invalid `kubernetes-version`" in invalid_result.stdout
try:
assert 1 == invalid_result.exit_code
assert invalid_result.exception
assert "Invalid `kubernetes-version`" in invalid_result.stdout
except AssertionError:
print(invalid_result.stdout)
raise


@pytest.mark.parametrize(
Expand Down

0 comments on commit 1f392e8

Please sign in to comment.