@@ -1495,3 +1495,52 @@ def test_yes_and_print_actions_together_prefers_print_actions(
14951495 # --print-actions exits before execute_actions
14961496 mi .return_value .execute_actions .assert_not_called ()
14971497 assert code == 0
1498+
1499+ def test_noninteractive_without_yes_does_not_execute (self , tmp_path , monkeypatch , capsys ):
1500+ """Non-interactive mode without --yes: dry-run only, execute_actions NOT called."""
1501+ mock_result , mock_scored , mock_scan , mock_action = self ._setup_mocks (tmp_path , monkeypatch )
1502+
1503+ monkeypatch .setattr ("sys.stdin.isatty" , lambda : False )
1504+
1505+ with (
1506+ patch ("main.Hunter" ) as mh ,
1507+ patch ("main.scan_skill" ) as ms ,
1508+ patch ("main.score_results" ) as msc ,
1509+ patch ("main.render_hunt_report" ),
1510+ patch ("main.build_action_list" , return_value = [mock_action ]),
1511+ patch ("main._list_installed_skills" , return_value = set ()),
1512+ patch ("main._get_dangerous_installed" , return_value = []),
1513+ patch ("main.Installer" ) as mi ,
1514+ ):
1515+ mh .return_value .hunt .return_value = [mock_result ]
1516+ ms .return_value = mock_scan
1517+ msc .return_value = [mock_scored ]
1518+ code = run (["hunt" , str (tmp_path )])
1519+
1520+ assert code == 0 , "dry-run mode should exit 0"
1521+ mi .return_value .execute_actions .assert_not_called ()
1522+ out = capsys .readouterr ().out
1523+ assert "--yes" in out , "should show --yes hint"
1524+
1525+ def test_privacy_prompt_emitted (self , tmp_path , monkeypatch , capsys ):
1526+ """Privacy notice should appear in output before hunting."""
1527+ mock_result , mock_scored , mock_scan , mock_action = self ._setup_mocks (tmp_path , monkeypatch )
1528+
1529+ monkeypatch .setattr ("sys.stdin.isatty" , lambda : False )
1530+
1531+ with (
1532+ patch ("main.Hunter" ) as mh ,
1533+ patch ("main.scan_skill" ) as ms ,
1534+ patch ("main.score_results" ) as msc ,
1535+ patch ("main.render_hunt_report" ),
1536+ patch ("main.build_action_list" , return_value = [mock_action ]),
1537+ patch ("main._list_installed_skills" , return_value = set ()),
1538+ patch ("main._get_dangerous_installed" , return_value = []),
1539+ ):
1540+ mh .return_value .hunt .return_value = [mock_result ]
1541+ ms .return_value = mock_scan
1542+ msc .return_value = [mock_scored ]
1543+ run (["hunt" , str (tmp_path )])
1544+
1545+ out = capsys .readouterr ().out
1546+ assert "Privacy" in out , "privacy notice must appear in output"
0 commit comments