Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

Merge pull request #1148 from KryptonGao/codex/start-deeptutor-command

Bingxi Zhao (Frank)06fb431132e3
diff --cc tests/runtime/test_macos_command_launcher.py
index 000000000,000000000..bb86709d5
new file mode 100644
--- /dev/null
+++ b/tests/runtime/test_macos_command_launcher.py
@@@ -1,0 -1,0 +1,40 @@@
++from __future__ import annotations
++
++from pathlib import Path
++import shutil
++import subprocess
++
++
++def test_macos_command_launcher_forwards_home_and_arguments(tmp_path: Path) -> None:
++ source = Path(__file__).resolve().parents[2] / "start_deeptutor.command"
++ launcher = tmp_path / source.name
++ shutil.copy2(source, launcher)
++
++ python = tmp_path / ".venv" / "bin" / "python"
++ python.parent.mkdir(parents=True)
++ python.write_text(
++ """#!/bin/sh
++if [ "$1" = "-c" ]; then
++ exit 0
++fi
++printf '%s\\n' "$@"
++""",
++ encoding="utf-8",
++ )
++ python.chmod(0o755)
++
++ result = subprocess.run(
++ [str(launcher), "--dev"],
++ check=True,
++ capture_output=True,
++ text=True,
++ )
++
++ assert result.stdout.splitlines()[-6:] == [
++ "-m",
++ "deeptutor_cli.main",
++ "start",
++ "--home",
++ str(tmp_path),
++ "--dev",
++ ]
diff --cc web/tests/build-wrapper.test.ts
index 92154c6b2,92154c6b2..efe5e263a
--- a/web/tests/build-wrapper.test.ts
+++ b/web/tests/build-wrapper.test.ts
@@@ -34,4 -34,4 +34,15 @@@ test("the build wrapper restores every
/stdio: "inherit"/,
"wrapper must preserve Next build diagnostics",
);
++ assert.match(
++ source,
++ /\[nextBin, "build", "--webpack", \.\.\.process\.argv\.slice\(2\)\]/,
++ "source production builds must use Webpack so Next emits standalone/server.js",
++ );
++});
++
++test("the standalone bundle is rooted where the Python launcher expects it", () => {
++ const source = read("next.config.js");
++ assert.match(source, /output:\s*"standalone"/);
++ assert.match(source, /outputFileTracingRoot:\s*__dirname/);
});