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

Function writeFiles

internal/attachments/attach_test.go:17–24  ·  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

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

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected