aboutsummaryrefslogtreecommitdiff
path: root/llm/codeinterpreter/python/python_test.go
blob: 7b22f657fb0681c6e51a6d3114f5e216dc3d7ece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package python

import (
	"context"
	"testing"
)

func TestRun(t *testing.T) {
	var code = `import sys

print(f"Python {sys.version} running in {sys.platform}/wazero.")`

	dir := t.TempDir()

	res, err := Run(context.Background(), dir, code)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("stdout: %s", res.Stdout)
	t.Logf("stderr: %s", res.Stderr)
}