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

Function TestGet_fileForced

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

Source from the content-addressed store, hash-verified

126}
127
128func TestGet_fileForced(t *testing.T) {
129 ctx := context.Background()
130
131 dst := testing_helper.TempDir(t)
132 u := testModule("basic")
133 u = "file::" + u
134
135 op, err := Get(ctx, dst, u)
136 if err != nil {
137 t.Fatalf("err: %s", err)
138 }
139 if diff := cmp.Diff(&GetResult{Dst: dst}, op); diff != "" {
140 t.Fatalf("unexpected op: %s", diff)
141 }
142
143 mainPath := filepath.Join(dst, "main.tf")
144 if _, err := os.Stat(mainPath); err != nil {
145 t.Fatalf("err: %s", err)
146 }
147}
148
149func TestGet_fileSubdir(t *testing.T) {
150 ctx := context.Background()

Callers

nothing calls this directly

Calls 2

testModuleFunction · 0.85
GetFunction · 0.85

Tested by

no test coverage detected