diff options
Diffstat (limited to 'clients/http/git_upload_pack_test.go')
-rw-r--r-- | clients/http/git_upload_pack_test.go | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/clients/http/git_upload_pack_test.go b/clients/http/git_upload_pack_test.go index b478445..603cd1b 100644 --- a/clients/http/git_upload_pack_test.go +++ b/clients/http/git_upload_pack_test.go @@ -1,6 +1,11 @@ package http -import . "gopkg.in/check.v1" +import ( + "io/ioutil" + + . "gopkg.in/check.v1" + "gopkg.in/src-d/go-git.v2/clients/common" +) type SuiteRemote struct{} @@ -30,3 +35,18 @@ func (s *SuiteRemote) TestCapabilities(c *C) { c.Assert(err, IsNil) c.Assert(info.Capabilities.Get("agent"), HasLen, 1) } + +func (s *SuiteRemote) TestFetch(c *C) { + r := NewGitUploadPackService() + c.Assert(r.Connect(RepositoryFixture), IsNil) + + reader, err := r.Fetch(&common.GitUploadPackRequest{ + Want: []string{"6ecf0ef2c2dffb796033e5a02219af86ec6584e5"}, + }) + + c.Assert(err, IsNil) + + b, err := ioutil.ReadAll(reader) + c.Assert(err, IsNil) + c.Assert(b, HasLen, 85374) +} |