writeFiles puts real files in a temporary working directory, because uploading opens the path it is given.
(t *testing.T, names ...string)
| 16 | // writeFiles puts real files in a temporary working directory, because |
| 17 | // uploading opens the path it is given. |
| 18 | func writeFiles(t *testing.T, names ...string) { |
| 19 | t.Helper() |
| 20 | |
| 21 | t.Chdir(t.TempDir()) |
| 22 | for _, name := range names { |
| 23 | require.NoError(t, os.WriteFile(name, []byte("the bytes"), 0o600)) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func testUploader(reg *httpmock.Registry) *Uploader { |
| 28 | return &Uploader{ |
no test coverage detected