MCPcopy
hub / github.com/kopia/kopia / mustWriteObject

Function mustWriteObject

repo/object/object_manager_test.go:680–693  ·  view source on GitHub ↗
(t *testing.T, om *Manager, data []byte, compressor compression.Name)

Source from the content-addressed store, hash-verified

678}
679
680func mustWriteObject(t *testing.T, om *Manager, data []byte, compressor compression.Name) ID {
681 t.Helper()
682
683 w := om.NewWriter(testlogging.Context(t), WriterOptions{Compressor: compressor})
684 defer w.Close()
685
686 _, err := w.Write(data)
687 require.NoError(t, err)
688
689 oid, err := w.Result()
690 require.NoError(t, err)
691
692 return oid
693}
694
695func TestReader(t *testing.T) {
696 ctx := testlogging.Context(t)

Callers 1

TestConcatenateFunction · 0.70

Calls 6

ResultMethod · 0.95
ContextFunction · 0.92
HelperMethod · 0.80
NewWriterMethod · 0.65
CloseMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected