11import pytest
22from unittest .mock import AsyncMock , patch , MagicMock
3- from src . badfish .main import Badfish , badfish_factory
4- from src . badfish .helpers .exceptions import BadfishException
3+ from badfish .main import Badfish , badfish_factory
4+ from badfish .helpers .exceptions import BadfishException
55
66
77class MockLogger :
@@ -386,7 +386,7 @@ class TestExecuteBadfishSessionCleanup:
386386 @pytest .mark .asyncio
387387 async def test_execute_badfish_session_cleanup_success (self ):
388388 """Test successful session cleanup in execute_badfish."""
389- from src . badfish .main import execute_badfish
389+ from badfish .main import execute_badfish
390390
391391 logger = MockLogger ()
392392 args = {
@@ -451,7 +451,7 @@ async def test_execute_badfish_session_cleanup_success(self):
451451 "set_nic_attribute" : None ,
452452 }
453453
454- with patch ("src. badfish.main.badfish_factory" ) as mock_factory :
454+ with patch ("badfish.main.badfish_factory" ) as mock_factory :
455455 # Mock badfish instance
456456 mock_badfish = MagicMock ()
457457 mock_badfish .session_id = "/redfish/v1/SessionService/Sessions/123"
@@ -469,7 +469,7 @@ async def test_execute_badfish_session_cleanup_success(self):
469469 @pytest .mark .asyncio
470470 async def test_execute_badfish_session_cleanup_failure (self ):
471471 """Test session cleanup failure in execute_badfish."""
472- from src . badfish .main import execute_badfish
472+ from badfish .main import execute_badfish
473473
474474 logger = MockLogger ()
475475 args = {
@@ -534,7 +534,7 @@ async def test_execute_badfish_session_cleanup_failure(self):
534534 "set_nic_attribute" : None ,
535535 }
536536
537- with patch ("src. badfish.main.badfish_factory" ) as mock_factory :
537+ with patch ("badfish.main.badfish_factory" ) as mock_factory :
538538 # Mock badfish instance
539539 mock_badfish = MagicMock ()
540540 mock_badfish .session_id = "/redfish/v1/SessionService/Sessions/123"
@@ -556,7 +556,7 @@ async def test_execute_badfish_session_cleanup_failure(self):
556556 @pytest .mark .asyncio
557557 async def test_execute_badfish_no_session_cleanup (self ):
558558 """Test execute_badfish when no session exists to clean up."""
559- from src . badfish .main import execute_badfish
559+ from badfish .main import execute_badfish
560560
561561 logger = MockLogger ()
562562 args = {
@@ -621,7 +621,7 @@ async def test_execute_badfish_no_session_cleanup(self):
621621 "set_nic_attribute" : None ,
622622 }
623623
624- with patch ("src. badfish.main.badfish_factory" ) as mock_factory :
624+ with patch ("badfish.main.badfish_factory" ) as mock_factory :
625625 # Mock badfish instance with no session_id
626626 mock_badfish = MagicMock ()
627627 mock_badfish .session_id = None
@@ -639,7 +639,7 @@ async def test_execute_badfish_no_session_cleanup(self):
639639 @pytest .mark .asyncio
640640 async def test_execute_badfish_no_badfish_instance (self ):
641641 """Test execute_badfish when badfish instance is None."""
642- from src . badfish .main import execute_badfish
642+ from badfish .main import execute_badfish
643643
644644 logger = MockLogger ()
645645 args = {
@@ -704,7 +704,7 @@ async def test_execute_badfish_no_badfish_instance(self):
704704 "set_nic_attribute" : None ,
705705 }
706706
707- with patch ("src. badfish.main.badfish_factory" ) as mock_factory :
707+ with patch ("badfish.main.badfish_factory" ) as mock_factory :
708708 # Mock badfish_factory to raise an exception
709709 mock_factory .side_effect = BadfishException ("Connection failed" )
710710
0 commit comments