MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / writeFakePythonScript

Function writeFakePythonScript

pkg/python/python_test.go:482–490  ·  view source on GitHub ↗

writeFakePythonScript is a helper to create fake python3 executable

(t *testing.T, binDir, version string)

Source from the content-addressed store, hash-verified

480}
481
482// writeFakePythonScript is a helper to create fake python3 executable
483func writeFakePythonScript(t *testing.T, binDir, version string) string {
484 t.Helper()
485 fakePython := filepath.Join(binDir, "python3")
486 content := fmt.Sprintf("#!/bin/sh\necho 'Python %s'\n", version)
487 if err := os.WriteFile(fakePython, []byte(content), 0755); err != nil {
488 t.Fatalf("Failed to write fake python script: %v", err)
489 }
490 return fakePython
491}
492
493func TestParseExecPrefix(t *testing.T) {

Callers 1

Calls 1

WriteFileMethod · 0.80

Tested by

no test coverage detected