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

Function TestGetFile_archiveNoUnarchive

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

Source from the content-addressed store, hash-verified

391}
392
393func TestGetFile_archiveNoUnarchive(t *testing.T) {
394 ctx := context.Background()
395
396 dst := testing_helper.TempTestFile(t)
397 defer os.RemoveAll(filepath.Dir(dst))
398 u := testModule("basic-file-archive/archive.tar.gz")
399 u += "?archive=false"
400
401 op, err := GetFile(ctx, dst, u)
402 if err != nil {
403 t.Fatalf("err: %s", err)
404 }
405 if diff := cmp.Diff(&GetResult{Dst: dst}, op); diff != "" {
406 t.Fatalf("unexpected op: %s", diff)
407 }
408
409 // Verify the main file exists
410 actual := testMD5(t, dst)
411 expected := "fbd90037dacc4b1ab40811d610dde2f0"
412 if actual != expected {
413 t.Fatalf("bad: %s", actual)
414 }
415}
416
417func TestGetFile_checksum(t *testing.T) {
418 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

testModuleFunction · 0.85
GetFileFunction · 0.85
testMD5Function · 0.85
DirMethod · 0.65

Tested by

no test coverage detected