Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/python-wasm/src/test/home.test.ts
1067 views
1
import { asyncPython, syncPython } from "../node";
2
3
test("that the default syncPython has the PYTHONHOME", async () => {
4
const { exec, repr } = await syncPython();
5
exec("import os");
6
expect(repr("os.environ.get('PYTHONHOME')")).toBe("'/usr'");
7
});
8
9
test("that the default asyncPython has the PYTHONHOME", async () => {
10
const { exec, repr, kernel } = await asyncPython();
11
await exec("import os");
12
expect(await repr("os.environ.get('PYTHONHOME')")).toBe("'/usr'");
13
await kernel.terminate();
14
});
15
16
test("also confirm that some interesting packages are installed", async () => {
17
const { exec } = await syncPython();
18
exec("import pandas, sympy");
19
}, 15000);
20
21