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

Unified Diff: cipd/client/cipd/local/reader_test.go

Issue 2684133002: [cipd] ignore .cipd/* while extracting. (Closed)
Patch Set: fix nits Created 3 years, 10 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 | « cipd/client/cipd/local/reader.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/local/reader_test.go
diff --git a/cipd/client/cipd/local/reader_test.go b/cipd/client/cipd/local/reader_test.go
index 1b3bbec26433be795289838c94f2a6e7055af60d..9f72df2c3e887e45f7cfc4b49e47d1e4a06c5b22 100644
--- a/cipd/client/cipd/local/reader_test.go
+++ b/cipd/client/cipd/local/reader_test.go
@@ -10,6 +10,7 @@ import (
"io"
"io/ioutil"
"os"
+ "strings"
"testing"
"golang.org/x/net/context"
@@ -143,6 +144,7 @@ func TestPackageReading(t *testing.T) {
Input: []File{
NewTestFile("testing/qwerty", "12345", false),
NewTestFile("abc", "duh", true),
+ NewTestFile("bad_dir/pkg/0/description.json", "{}", false),
NewTestSymlink("rel_symlink", "abc"),
NewTestSymlink("abs_symlink", "/abc/def"),
},
@@ -160,7 +162,9 @@ func TestPackageReading(t *testing.T) {
}
So(err, ShouldBeNil)
dest := &testDestination{}
- err = ExtractInstance(ctx, inst, dest)
+ err = ExtractInstance(ctx, inst, dest, func(f File) bool {
+ return strings.HasPrefix(f.Name(), "bad_dir/")
+ })
So(err, ShouldBeNil)
So(dest.beginCalls, ShouldEqual, 1)
So(dest.endCalls, ShouldEqual, 1)
@@ -185,7 +189,7 @@ func TestPackageReading(t *testing.T) {
// Verify version file is correct.
goodVersionFile := `{
- "instance_id": "dd08e20d0e436c5c778ccbd87c99a05182dc5558",
+ "instance_id": "5503734d74bc46f2b4d59c23bf4b1293696861a9",
"package_name": "testing"
}`
So(dest.files[4].name, ShouldEqual, "subpath/version.json")
« no previous file with comments | « cipd/client/cipd/local/reader.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698