blob: 639670911cbda62e75417197a53c9533a7b7526a [file] [log] [blame]
Jack Neus08ccd452019-08-13 09:35:41 -06001// 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 Abraham47cc5852020-06-30 09:32:41 -06004
Sean Abrahamc2c5a6a2020-06-23 17:54:41 -06005package branch
Jack Neus08ccd452019-08-13 09:35:41 -06006
7import (
8 "testing"
9
10 "go.chromium.org/chromiumos/infra/go/internal/repo"
11 "gotest.tools/assert"
12)
13
14func TestProjectFetchUrl(t *testing.T) {
Sean Abrahamc2c5a6a2020-06-23 17:54:41 -060015 WorkingManifest = repo.Manifest{
Jack Neus08ccd452019-08-13 09:35:41 -060016 Remotes: []repo.Remote{
17 {Name: "remote", Fetch: "file:///tmp/path/to/remote"},
18 },
19 Projects: []repo.Project{
20 {Path: "foo/bar/project", Name: "foo/bar/project", RemoteName: "remote"},
21 },
22 }
Sean Abrahamc2c5a6a2020-06-23 17:54:41 -060023 url, err := ProjectFetchUrl("foo/bar/project")
Jack Neus08ccd452019-08-13 09:35:41 -060024 assert.NilError(t, err)
25 assert.Equal(t, url, "file:///tmp/path/to/remote/foo/bar/project")
26}