Skip to content
Myr

test(context): add cleanup for uploaded file in SaveUploadedFile test (#4248)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Flc゛ · committed by GitHub · parent 40725d8 · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Flc <four_leaf_clover@foxmail.com>

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:context_test.go+3 added
172 unmodified lines
173 require.NoError(t, err)174 assert.Equal(t, "permission_test", f.Filename)175 var mode fs.FileMode = 0o755176 require.NoError(t, c.SaveUploadedFile(f, "permission_test", mode))177 t.Cleanup(func() {178 assert.NoError(t, os.Remove("permission_test"))179 })180 info, err := os.Stat(filepath.Dir("permission_test"))181 require.NoError(t, err)182 assert.Equal(t, info.Mode().Perm(), mode)183}
3104 unmodified lines