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

@@ -40,12 +40,9 @@ func TestAudio(t *testing.T) {
ctx := context.Background()
dir, cleanup := test.CreateTestDirectory(t)
defer cleanup()
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
path := filepath.Join(dir, "fake.mp3")
path := filepath.Join(t.TempDir(), "fake.mp3")
test.CreateTestFile(t, path)
req := openai.AudioRequest{
@@ -90,12 +87,9 @@ func TestAudioWithOptionalArgs(t *testing.T) {
ctx := context.Background()
dir, cleanup := test.CreateTestDirectory(t)
defer cleanup()
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
path := filepath.Join(dir, "fake.mp3")
path := filepath.Join(t.TempDir(), "fake.mp3")
test.CreateTestFile(t, path)
req := openai.AudioRequest{