Jack Neus | 08ccd45 | 2019-08-13 09:35:41 -0600 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Sean Abraham | c2c5a6a | 2020-06-23 17:54:41 -0600 | [diff] [blame] | 4 | package branch |
Jack Neus | 08ccd45 | 2019-08-13 09:35:41 -0600 | [diff] [blame] | 5 | |
| 6 | import ( |
| 7 | "testing" |
| 8 | |
| 9 | "go.chromium.org/chromiumos/infra/go/internal/repo" |
| 10 | "gotest.tools/assert" |
| 11 | ) |
| 12 | |
| 13 | func TestProjectFetchUrl(t *testing.T) { |
Sean Abraham | c2c5a6a | 2020-06-23 17:54:41 -0600 | [diff] [blame] | 14 | WorkingManifest = repo.Manifest{ |
Jack Neus | 08ccd45 | 2019-08-13 09:35:41 -0600 | [diff] [blame] | 15 | Remotes: []repo.Remote{ |
| 16 | {Name: "remote", Fetch: "file:///tmp/path/to/remote"}, |
| 17 | }, |
| 18 | Projects: []repo.Project{ |
| 19 | {Path: "foo/bar/project", Name: "foo/bar/project", RemoteName: "remote"}, |
| 20 | }, |
| 21 | } |
Sean Abraham | c2c5a6a | 2020-06-23 17:54:41 -0600 | [diff] [blame] | 22 | url, err := ProjectFetchUrl("foo/bar/project") |
Jack Neus | 08ccd45 | 2019-08-13 09:35:41 -0600 | [diff] [blame] | 23 | assert.NilError(t, err) |
| 24 | assert.Equal(t, url, "file:///tmp/path/to/remote/foo/bar/project") |
| 25 | } |