@@ -72,25 +72,13 @@ func TestWriteEnvFile(t *testing.T) {
7272 // Create mock Python executable
7373 var pythonPath string
7474 if runtime .GOOS == "windows" {
75- pythonPath = filepath .Join (binDir , "python.exe" )
76- pythonScript := `@echo off
77- echo /mock/path1;/mock/path2
78- `
79- if err := os .WriteFile (pythonPath , []byte (pythonScript ), 0644 ); err != nil {
80- t .Fatal (err )
81- }
75+ pythonPath = "/mock/path1;/mock/path2"
8276 } else {
83- pythonPath = filepath .Join (binDir , "python" )
84- pythonScript := `#!/bin/sh
85- echo "/mock/path1:/mock/path2"
86- `
87- if err := os .WriteFile (pythonPath , []byte (pythonScript ), 0755 ); err != nil {
88- t .Fatal (err )
89- }
77+ pythonPath = "/mock/path1:/mock/path2"
9078 }
9179
9280 // Test writing env file
93- if err := WriteEnvFile (projectDir ); err != nil {
81+ if err := WriteEnvFile (projectDir , pythonDir , pythonPath ); err != nil {
9482 t .Errorf ("writeEnvFile() error = %v, want nil" , err )
9583 return
9684 }
@@ -129,16 +117,4 @@ echo "/mock/path1:/mock/path2"
129117 }
130118 }
131119 })
132-
133- t .Run ("missing python executable" , func (t * testing.T ) {
134- tmpDir := t .TempDir ()
135- if err := os .MkdirAll (filepath .Join (tmpDir , ".deps/python" ), 0755 ); err != nil {
136- t .Fatal (err )
137- }
138-
139- err := WriteEnvFile (tmpDir )
140- if err == nil {
141- t .Error ("writeEnvFile() error = nil, want error for missing python executable" )
142- }
143- })
144120}
0 commit comments