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

Function TestGet_archiveRooted

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

Source from the content-addressed store, hash-verified

209}
210
211func TestGet_archiveRooted(t *testing.T) {
212 ctx := context.Background()
213
214 dst := testing_helper.TempDir(t)
215 u := testModule("archive-rooted/archive.tar.gz")
216 op, err := Get(ctx, dst, u)
217 if err != nil {
218 t.Fatalf("err: %s", err)
219 }
220 if diff := cmp.Diff(&GetResult{Dst: dst}, op); diff != "" {
221 t.Fatalf("unexpected op: %s", diff)
222 }
223
224 mainPath := filepath.Join(dst, "root", "hello.txt")
225 if _, err := os.Stat(mainPath); err != nil {
226 t.Fatalf("err: %s", err)
227 }
228}
229
230func TestGet_archiveSubdirWild(t *testing.T) {
231 ctx := context.Background()

Callers

nothing calls this directly

Calls 2

testModuleFunction · 0.85
GetFunction · 0.85

Tested by

no test coverage detected