MCPcopy Create free account
hub / github.com/brimdata/super / TestDirS3Source

Function TestDirS3Source

sio/emitter/split_test.go:20–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18)
19
20func TestDirS3Source(t *testing.T) {
21 t.Skip("split by _path no longer supported")
22 path := "s3://testbucket/dir"
23 const input = `
24{_path:"conn",foo:"1"}
25{_path:"http",bar:"2"}
26`
27 uri, err := storage.ParseURI(path)
28 require.NoError(t, err)
29 ctrl := gomock.NewController(t)
30 defer ctrl.Finish()
31 engine := storagemock.NewMockEngine(ctrl)
32
33 engine.EXPECT().Put(t.Context(), uri.JoinPath("conn.sup")).
34 Return(sio.NopCloser(bytes.NewBuffer(nil)), nil)
35 engine.EXPECT().Put(t.Context(), uri.JoinPath("http.sup")).
36 Return(sio.NopCloser(bytes.NewBuffer(nil)), nil)
37
38 sctx := super.NewContext()
39 r := supio.NewReader(sctx, strings.NewReader(input))
40 require.NoError(t, err)
41 w, err := NewSplit(t.Context(), engine, uri, "", false, anyio.WriterOpts{Format: "sup"})
42 require.NoError(t, err)
43 require.NoError(t, vio.Copy(w, sbuf.NewDematerializer(sctx, sbuf.NewPuller(r))))
44}

Callers

nothing calls this directly

Calls 13

EXPECTMethod · 0.95
ParseURIFunction · 0.92
NopCloserFunction · 0.92
NewContextFunction · 0.92
NewReaderFunction · 0.92
CopyFunction · 0.92
NewDematerializerFunction · 0.92
NewPullerFunction · 0.92
NewSplitFunction · 0.85
ContextMethod · 0.80
JoinPathMethod · 0.80
PutMethod · 0.65

Tested by

no test coverage detected