writeTempTokenFile writes the token to a temporary file and returns the path.
(t *testing.T, token string)
| 255 | |
| 256 | // writeTempTokenFile writes the token to a temporary file and returns the path. |
| 257 | func writeTempTokenFile(t *testing.T, token string) string { |
| 258 | t.Helper() |
| 259 | tempDir := t.TempDir() |
| 260 | filePath := filepath.Join(tempDir, "token") |
| 261 | if err := os.WriteFile(filePath, []byte(token), 0600); err != nil { |
| 262 | t.Fatalf("Failed to write temp token file: %v", err) |
| 263 | } |
| 264 | return filePath |
| 265 | } |
no test coverage detected