import unittest from pathlib import Path class StartScriptTests(unittest.TestCase): def test_script_is_local_overridable_and_avoids_system_changes(self) -> None: repository_root = Path(__file__).resolve().parents[2] script = (repository_root / "scripts" / "start-javis.ps1").read_text(encoding="utf-8") normalized = script.lower() self.assertIn("$psscriptroot", normalized) self.assertIn("http://127.0.0.1:11434/api/version", normalized) self.assertIn("-windowstyle hidden", normalized) self.assertIn("javis_uv_path", normalized) self.assertIn("javis_ollama_path", normalized) self.assertIn("javis_data_dir", normalized) self.assertIn("run javis chat", normalized) self.assertNotIn("c:\\users\\", normalized) for forbidden in ( "set-executionpolicy", "setx ", "new-service", "schtasks", "hkey_", ): self.assertNotIn(forbidden, normalized) def test_gui_script_reuses_safe_starter_without_system_changes(self) -> None: repository_root = Path(__file__).resolve().parents[2] script = (repository_root / "scripts" / "start-javis-gui.ps1").read_text(encoding="utf-8") normalized = script.lower() self.assertIn("start-javis.ps1", normalized) self.assertIn("javis_start_interface", normalized) self.assertIn("'gui'", normalized) self.assertNotIn("c:\\users\\", normalized) for forbidden in ( "set-executionpolicy", "setx ", "new-service", "schtasks", "hkey_", ): self.assertNotIn(forbidden, normalized) if __name__ == "__main__": unittest.main()