From 3d6ed3eb33b973f3c07470925aa63b158a9d175c Mon Sep 17 00:00:00 2001 From: "kanza.latif" Date: Wed, 1 Jan 2025 09:40:17 +0500 Subject: [PATCH] passed validate params test case --- tests/test_config_stp.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/test_config_stp.py b/tests/test_config_stp.py index e7cf5877ba..022cfbe49a 100644 --- a/tests/test_config_stp.py +++ b/tests/test_config_stp.py @@ -158,17 +158,11 @@ def test_disable_global_mst(): def test_validate_params(): - mock_ctx = MagicMock() - # Valid parameter - try: - validate_params(mock_ctx, "bridge_priority", 32768) - except SystemExit: - pytest.fail("Unexpected failure on valid parameter") + assert validate_params(15, 20, 5) is True # This should pass as the values meet the condition # Invalid parameter - with pytest.raises(SystemExit): - validate_params(mock_ctx, "bridge_priority", 99999) + assert validate_params(15, 50, 5) is False # This should fail as the condition is not met def test_get_bridge_mac_address():