Simplify tests with T.TempDir (#929)

This commit is contained in:
Oleksandr Redko
2025-01-31 20:55:41 +02:00
committed by GitHub
parent 2a0ff5ac63
commit 7a2915a37d
8 changed files with 24 additions and 70 deletions

View File

@@ -21,10 +21,8 @@ func TestSpeechIntegration(t *testing.T) {
defer teardown()
server.RegisterHandler("/v1/audio/speech", func(w http.ResponseWriter, r *http.Request) {
dir, cleanup := test.CreateTestDirectory(t)
path := filepath.Join(dir, "fake.mp3")
path := filepath.Join(t.TempDir(), "fake.mp3")
test.CreateTestFile(t, path)
defer cleanup()
// audio endpoints only accept POST requests
if r.Method != "POST" {