MCPcopy Create free account
hub / github.com/dagger/dagger / newDirWithFile

Function newDirWithFile

core/integration/suite_test.go:94–115  ·  view source on GitHub ↗
(t *testctx.T, path, contents string)

Source from the content-addressed store, hash-verified

92}
93
94func newDirWithFile(t *testctx.T, path, contents string) core.DirectoryID {
95 res, err := testutil.Query[struct {
96 Directory struct {
97 WithNewFile struct {
98 ID core.DirectoryID
99 }
100 }
101 }](t,
102 `query Test($path: String!, $contents: String!) {
103 directory {
104 withNewFile(path: $path, contents: $contents) {
105 id
106 }
107 }
108 }`, &testutil.QueryOptions{Variables: map[string]any{
109 "path": path,
110 "contents": contents,
111 }})
112 require.NoError(t, err)
113
114 return res.Directory.WithNewFile.ID
115}
116
117func newFile(t *testctx.T, path, contents string) core.FileID {
118 res, err := testutil.Query[struct {

Callers 3

TestFileMethod · 0.85
TestFileErrorsMethod · 0.85
TestDiffMethod · 0.85

Calls 1

QueryFunction · 0.92

Tested by

no test coverage detected