MCPcopy Create free account
hub / github.com/cli/cli / writeFiles

Function writeFiles

internal/attachments/attach_test.go:18–25  ·  view source on GitHub ↗

writeFiles puts real files in a temporary working directory, because uploading opens the path it is given.

(t *testing.T, names ...string)

Source from the content-addressed store, hash-verified

16// writeFiles puts real files in a temporary working directory, because
17// uploading opens the path it is given.
18func writeFiles(t *testing.T, names ...string) {
19 t.Helper()
20
21 t.Chdir(t.TempDir())
22 for _, name := range names {
23 require.NoError(t, os.WriteFile(name, []byte("the bytes"), 0o600))
24 }
25}
26
27func testUploader(reg *httpmock.Registry) *Uploader {
28 return &Uploader{

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected