@@ -677,10 +677,12 @@ def test_kiro_alias_normalized_to_kiro_cli(self, tmp_path):
677677 target = tmp_path / "kiro-alias-proj"
678678
679679 with patch ("specify_cli.download_and_extract_template" ) as mock_download , \
680+ patch ("specify_cli.scaffold_from_core_pack" , create = True ) as mock_scaffold , \
680681 patch ("specify_cli.ensure_executable_scripts" ), \
681682 patch ("specify_cli.ensure_constitution_from_template" ), \
682683 patch ("specify_cli.is_git_repo" , return_value = False ), \
683684 patch ("specify_cli.shutil.which" , return_value = "/usr/bin/git" ):
685+ mock_scaffold .return_value = True
684686 result = runner .invoke (
685687 app ,
686688 [
@@ -696,9 +698,14 @@ def test_kiro_alias_normalized_to_kiro_cli(self, tmp_path):
696698 )
697699
698700 assert result .exit_code == 0
699- assert mock_download .called
700- # download_and_extract_template(project_path, ai_assistant, script_type, ...)
701- assert mock_download .call_args .args [1 ] == "kiro-cli"
701+ # Alias normalisation should have happened regardless of scaffold path used.
702+ # Either scaffold_from_core_pack or download_and_extract_template may be called
703+ # depending on whether bundled assets are present; check the one that was called.
704+ if mock_scaffold .called :
705+ assert mock_scaffold .call_args .args [1 ] == "kiro-cli"
706+ else :
707+ assert mock_download .called
708+ assert mock_download .call_args .args [1 ] == "kiro-cli"
702709
703710 def test_q_removed_from_agent_config (self ):
704711 """Amazon Q legacy key should not remain in AGENT_CONFIG."""
0 commit comments