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