Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: go/src/infra/tools/cipd/local/reader_test.go

Issue 1129043003: cipd: Refactor client to make it more readable. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/tools/cipd/local/reader.go ('k') | go/src/infra/tools/cipd/local/testing.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tools/cipd/local/reader_test.go
diff --git a/go/src/infra/tools/cipd/reader_test.go b/go/src/infra/tools/cipd/local/reader_test.go
similarity index 93%
rename from go/src/infra/tools/cipd/reader_test.go
rename to go/src/infra/tools/cipd/local/reader_test.go
index d61028c79bda6b40c41e944146e19e95bc2bf933..4ad3715dbf867a9a8dff3c3554cc11735db74aea 100644
--- a/go/src/infra/tools/cipd/reader_test.go
+++ b/go/src/infra/tools/cipd/local/reader_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package cipd
+package local
import (
"bytes"
@@ -12,6 +12,8 @@ import (
"testing"
. "github.com/smartystreets/goconvey/convey"
+
+ . "infra/tools/cipd/common"
)
func TestPackageReading(t *testing.T) {
@@ -36,8 +38,7 @@ func TestPackageReading(t *testing.T) {
}
So(inst, ShouldNotBeNil)
So(err, ShouldBeNil)
- So(inst.PackageName(), ShouldEqual, "testing")
- So(inst.InstanceID(), ShouldEqual, "23f2c4900785ac8faa2f38e473925b840e574ccc")
+ So(inst.Pin(), ShouldResemble, Pin{"testing", "23f2c4900785ac8faa2f38e473925b840e574ccc"})
So(len(inst.Files()), ShouldEqual, 1)
// Contains single manifest file.
@@ -106,10 +107,10 @@ func TestPackageReading(t *testing.T) {
out := bytes.Buffer{}
err := BuildInstance(BuildInstanceOptions{
Input: []File{
- makeTestFile("testing/qwerty", "12345", false),
- makeTestFile("abc", "duh", true),
- makeTestSymlink("rel_symlink", "abc"),
- makeTestSymlink("abs_symlink", "/abc/def"),
+ NewTestFile("testing/qwerty", "12345", false),
+ NewTestFile("abc", "duh", true),
+ NewTestSymlink("rel_symlink", "abc"),
+ NewTestSymlink("abs_symlink", "/abc/def"),
},
Output: &out,
PackageName: "testing",
« no previous file with comments | « go/src/infra/tools/cipd/local/reader.go ('k') | go/src/infra/tools/cipd/local/testing.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698