Upload a file to a remote
(t *testing.T, f fs.Fs, remote, contents string)
| 30 | |
| 31 | // Upload a file to a remote |
| 32 | func uploadFile(t *testing.T, f fs.Fs, remote, contents string) (obj fs.Object) { |
| 33 | inBuf := bytes.NewBufferString(contents) |
| 34 | t1 := time.Date(2012, time.December, 17, 18, 32, 31, 0, time.UTC) |
| 35 | upSrc := object.NewStaticObjectInfo(remote, t1, int64(len(contents)), true, nil, nil) |
| 36 | obj, err := f.Put(context.Background(), inBuf, upSrc) |
| 37 | require.NoError(t, err) |
| 38 | t.Cleanup(func() { |
| 39 | require.NoError(t, obj.Remove(context.Background())) |
| 40 | }) |
| 41 | return obj |
| 42 | } |
| 43 | |
| 44 | // Test the ObjectInfo |
| 45 | func testObjectInfo(t *testing.T, f *Fs, wrap bool) { |
no test coverage detected
searching dependent graphs…