From ba929db4e5e357faae0365bfb9ffe3f86cf512a8 Mon Sep 17 00:00:00 2001 From: SafetyQuincyF Date: Wed, 23 Oct 2024 16:51:08 -0400 Subject: [PATCH] fix/removes hardcoded safety release version from a test --- tests/test_cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 14082564..1a21b91a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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 @@ -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}" ) @@ -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) \ No newline at end of file + mock_basicConfig.assert_called_with(format='%(asctime)s %(name)s => %(message)s', level=logging.CRITICAL)