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

Function TestAddAuthFromNetrc_hasAuth

netrc_test.go:27–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestAddAuthFromNetrc_hasAuth(t *testing.T) {
28 defer tempEnv(t, "NETRC", "./testdata/netrc/basic")()
29
30 u, err := url.Parse("http://username:password@example.com")
31 if err != nil {
32 t.Fatalf("err: %s", err)
33 }
34
35 expected := u.String()
36 if err := addAuthFromNetrc(u); err != nil {
37 t.Fatalf("err: %s", err)
38 }
39
40 actual := u.String()
41 if expected != actual {
42 t.Fatalf("Mismatch: %q != %q", actual, expected)
43 }
44}
45
46func TestAddAuthFromNetrc_hasUsername(t *testing.T) {
47 defer tempEnv(t, "NETRC", "./testdata/netrc/basic")()

Callers

nothing calls this directly

Calls 3

tempEnvFunction · 0.85
addAuthFromNetrcFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected