Skip to content

Commit 0fd0ef4

Browse files
committed
fix: Fix tests on windows
1 parent a439678 commit 0fd0ef4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/embedded_python_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package python
22

33
import (
4+
"bytes"
45
"fmt"
56
"github.com/kluctl/go-embed-python/internal"
67
"github.com/stretchr/testify/assert"
@@ -19,7 +20,7 @@ func TestEmbeddedPython(t *testing.T) {
1920
pexe := ep.GetExePath()
2021
assert.True(t, internal.Exists(pexe))
2122

22-
cmd := ep.PythonCmd("-c", "print('test')")
23+
cmd := ep.PythonCmd("-c", "print('test test')")
2324
stdout, err := cmd.StdoutPipe()
2425
assert.NoError(t, err)
2526
defer stdout.Close()
@@ -33,5 +34,6 @@ func TestEmbeddedPython(t *testing.T) {
3334
err = cmd.Wait()
3435
assert.NoError(t, err)
3536

36-
assert.Equal(t, "test\n", string(stdoutStr))
37+
stdoutStr = bytes.TrimSpace(stdoutStr)
38+
assert.Equal(t, "test test", string(stdoutStr))
3739
}

0 commit comments

Comments
 (0)