blob: 7b972769576ac38ca58708750310ad991b0b86b6 [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 Abrahamc2c5a6a2020-06-23 17:54:41 -06004package branch
Jack Neus08ccd452019-08-13 09:35:41 -06005
6import (
7 "testing"
8
9 "go.chromium.org/chromiumos/infra/go/internal/repo"
10 "gotest.tools/assert"
11)
12
13func TestProjectFetchUrl(t *testing.T) {
Sean Abrahamc2c5a6a2020-06-23 17:54:41 -060014 WorkingManifest = repo.Manifest{
Jack Neus08ccd452019-08-13 09:35:41 -060015 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 Abrahamc2c5a6a2020-06-23 17:54:41 -060022 url, err := ProjectFetchUrl("foo/bar/project")
Jack Neus08ccd452019-08-13 09:35:41 -060023 assert.NilError(t, err)
24 assert.Equal(t, url, "file:///tmp/path/to/remote/foo/bar/project")
25}