31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
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)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|