(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestAddAuthFromNetrc(t *testing.T) { |
| 9 | defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() |
| 10 | |
| 11 | u, err := url.Parse("http://example.com") |
| 12 | if err != nil { |
| 13 | t.Fatalf("err: %s", err) |
| 14 | } |
| 15 | |
| 16 | if err := addAuthFromNetrc(u); err != nil { |
| 17 | t.Fatalf("err: %s", err) |
| 18 | } |
| 19 | |
| 20 | expected := "http://foo:bar@example.com" |
| 21 | actual := u.String() |
| 22 | if expected != actual { |
| 23 | t.Fatalf("Mismatch: %q != %q", actual, expected) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestAddAuthFromNetrc_hasAuth(t *testing.T) { |
| 28 | defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() |
nothing calls this directly
no test coverage detected