MCPcopy
hub / github.com/rclone/rclone / writeObjectBytes

Method writeObjectBytes

backend/cache/cache_internal_test.go:1002–1009  ·  view source on GitHub ↗
(t *testing.T, f fs.Fs, remote string, data []byte)

Source from the content-addressed store, hash-verified

1000}
1001
1002func (r *run) writeObjectBytes(t *testing.T, f fs.Fs, remote string, data []byte) fs.Object {
1003 in := bytes.NewReader(data)
1004 _ = r.writeObjectReader(t, f, remote, in)
1005 o, err := f.NewObject(context.Background(), remote)
1006 require.NoError(t, err)
1007 require.Equal(t, int64(len(data)), o.Size())
1008 return o
1009}
1010
1011func (r *run) writeObjectReader(t *testing.T, f fs.Fs, remote string, in io.Reader) fs.Object {
1012 modTime := time.Now()

Calls 4

writeObjectReaderMethod · 0.95
SizeMethod · 0.95
NewObjectMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected