MCPcopy
hub / github.com/hashicorp/go-getter / TestGetFile_archiveChecksum

Function TestGetFile_archiveChecksum

get_test.go:373–391  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

371}
372
373func TestGetFile_archiveChecksum(t *testing.T) {
374 ctx := context.Background()
375
376 dst := testing_helper.TempTestFile(t)
377 defer os.RemoveAll(filepath.Dir(dst))
378 u := testModule(
379 "basic-file-archive/archive.tar.gz?checksum=md5:fbd90037dacc4b1ab40811d610dde2f0")
380
381 op, err := GetFile(ctx, dst, u)
382 if err != nil {
383 t.Fatalf("err: %s", err)
384 }
385 if diff := cmp.Diff(&GetResult{Dst: dst}, op); diff != "" {
386 t.Fatalf("unexpected op: %s", diff)
387 }
388
389 // Verify the main file exists
390 testing_helper.AssertContents(t, dst, "Hello\n")
391}
392
393func TestGetFile_archiveNoUnarchive(t *testing.T) {
394 ctx := context.Background()

Callers

nothing calls this directly

Calls 3

testModuleFunction · 0.85
GetFileFunction · 0.85
DirMethod · 0.65

Tested by

no test coverage detected