MCPcopy
hub / github.com/rclone/rclone / uploadFile

Function uploadFile

backend/crypt/crypt_internal_test.go:32–42  ·  view source on GitHub ↗

Upload a file to a remote

(t *testing.T, f fs.Fs, remote, contents string)

Source from the content-addressed store, hash-verified

30
31// Upload a file to a remote
32func 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
45func testObjectInfo(t *testing.T, f *Fs, wrap bool) {

Callers 2

testObjectInfoFunction · 0.70
testComputeHashFunction · 0.70

Calls 3

NewStaticObjectInfoFunction · 0.92
PutMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…