@@ -359,48 +359,6 @@ def test_main_verbose_output(monkeypatch, tmp_path, capsys):
359359 assert "Generation time:" in captured .out
360360
361361
362- def test_main_defaults_strategy_and_interchange (monkeypatch , tmp_path ):
363- """
364- @brief Test that main uses default values for strategy and interchange when not provided.
365- """
366- input_file = tmp_path / "kernel.pisa"
367- input_file .write_text ("dummy" )
368- output_file = tmp_path / "output.pisa"
369-
370- dummy_model = object ()
371- dummy_insts = [mock .Mock (to_pisa_format = mock .Mock (return_value = "inst" ))]
372-
373- monkeypatch .setattr (he_prep , "MemoryModel" , mock .Mock (return_value = dummy_model ))
374- monkeypatch .setattr (
375- he_prep .preprocessor ,
376- "preprocess_pisa_kernel_listing" ,
377- mock .Mock (return_value = dummy_insts ),
378- )
379- assign_mock = mock .Mock ()
380- monkeypatch .setattr (he_prep .preprocessor , "assign_register_banks_to_vars" , assign_mock )
381-
382- # Create args without strategy/interchange using argparse.Namespace
383- # This properly raises AttributeError for missing attributes
384- args = type (
385- "Args" ,
386- (),
387- {
388- "input_file_name" : str (input_file ),
389- "output_file_name" : str (output_file ),
390- "mem_file" : "" ,
391- "verbose" : 0 ,
392- "split_on" : False ,
393- },
394- )()
395-
396- he_prep .main (args )
397-
398- assign_mock .assert_called_once ()
399- _ , kwargs = assign_mock .call_args
400- assert kwargs ["strategy" ] == "largest_first" # Default
401- assert kwargs ["interchange" ] is False # Default
402-
403-
404362def test_parse_args_defaults ():
405363 """
406364 @brief Test that parse_args sets correct defaults when optional args not provided.
0 commit comments