1111
1212from autobisect .evaluators import BrowserEvaluator , EvaluatorResult
1313from autobisect .evaluators .browser .browser import BrowserEvaluatorException
14+ from grizzly .common .storage import TestCase
1415
1516
1617def not_linux ():
@@ -100,11 +101,7 @@ def test_launch_simple(mocker, tmp_path, scan_dir):
100101 testcase .touch ()
101102
102103 # Mock TestCase.load to verify correct behavior
103- mock_testcase = MagicMock ()
104- mock_load = mocker .patch (
105- "autobisect.evaluators.browser.browser.TestCase.load" ,
106- return_value = mock_testcase ,
107- )
104+ testcase_spy = mocker .spy (TestCase , "load" )
108105
109106 evaluator = BrowserEvaluator (testcase , scan_dir = scan_dir )
110107
@@ -114,12 +111,8 @@ def test_launch_simple(mocker, tmp_path, scan_dir):
114111 )
115112
116113 # Verify TestCase.load behavior based on scan_dir
117- if scan_dir :
118- # When scan_dir=True, load is called with testcase.parent (test_dir in this case)
119- mock_load .assert_called_with (test_dir , catalog = True )
120- assert mock_testcase .entry_point == str (testcase )
121- else :
122- mock_load .assert_called_with (testcase , catalog = False )
114+ testcase_spy .assert_called_once_with (test_dir , testcase , catalog = scan_dir )
115+ assert testcase_spy .spy_return .entry_point == str (testcase .name )
123116
124117 assert (
125118 evaluator .launch (binary , testcase , scan_dir = scan_dir )
0 commit comments