Skip to content

Commit

Permalink
Merge pull request #616 from pyupio/fix/version-test
Browse files Browse the repository at this point in the history
fix/safety debug version test
  • Loading branch information
SafetyQuincyF authored Oct 24, 2024
2 parents 212318c + ba929db commit 7b21f3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from safety import cli
from safety.models import CVE, SafetyRequirement, Severity, Vulnerability
from safety.util import Package, SafetyContext
from safety.util import Package, SafetyContext, get_safety_version
from safety.auth.models import Auth
from safety_schemas.models.base import AuthenticationType

Expand Down Expand Up @@ -533,7 +533,7 @@ def test_debug_flag(self, mock_get_auth_info, mock_is_valid, mock_get_auth_type,
assert result.exit_code == 0, (
f"CLI exited with code {result.exit_code} and output: {result.output} and error: {result.stderr}"
)
expected_output_snippet = "Safety 3.2.8 scanning"
expected_output_snippet = f"{get_safety_version()} scanning"
assert expected_output_snippet in result.output, (
f"Expected output to contain: {expected_output_snippet}, but got: {result.output}"
)
Expand Down Expand Up @@ -665,4 +665,4 @@ def test_configure_logger_non_debug(self, mock_config_read):

with patch('logging.basicConfig') as mock_basicConfig:
cli.configure_logger(ctx, param, debug)
mock_basicConfig.assert_called_with(format='%(asctime)s %(name)s => %(message)s', level=logging.CRITICAL)
mock_basicConfig.assert_called_with(format='%(asctime)s %(name)s => %(message)s', level=logging.CRITICAL)

0 comments on commit 7b21f3a

Please sign in to comment.