(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestHgGetter_GetFile(t *testing.T) { |
| 99 | if !testHasHg { |
| 100 | t.Log("hg not found, skipping") |
| 101 | t.Skip() |
| 102 | } |
| 103 | ctx := context.Background() |
| 104 | |
| 105 | g := new(HgGetter) |
| 106 | dst := testing_helper.TempTestFile(t) |
| 107 | defer os.RemoveAll(filepath.Dir(dst)) |
| 108 | |
| 109 | req := &Request{ |
| 110 | Dst: dst, |
| 111 | u: testModuleURL("basic-hg/foo.txt"), |
| 112 | } |
| 113 | |
| 114 | // Download |
| 115 | if err := g.GetFile(ctx, req); err != nil { |
| 116 | t.Fatalf("err: %s", err) |
| 117 | } |
| 118 | |
| 119 | // Verify the main file exists |
| 120 | if _, err := os.Stat(dst); err != nil { |
| 121 | t.Fatalf("err: %s", err) |
| 122 | } |
| 123 | testing_helper.AssertContents(t, dst, "Hello\n") |
| 124 | } |
| 125 | func TestHgGetter_HgArgumentsNotAllowed(t *testing.T) { |
| 126 | if !testHasHg { |
| 127 | t.Log("hg not found, skipping") |
nothing calls this directly
no test coverage detected