From e1d8866ffa78fa16d2f39b0ba5344a7269ee5371 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Fri, 23 Oct 2015 02:26:15 +0200 Subject: clients and remote: fetch implementation --- clients/http/git_upload_pack_test.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'clients/http/git_upload_pack_test.go') 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) +} -- cgit