diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-23 02:26:15 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-23 02:26:15 +0200 |
commit | e1d8866ffa78fa16d2f39b0ba5344a7269ee5371 (patch) | |
tree | 4602b0ca341187aad77048f807cde423af410554 /clients/http/git_upload_pack_test.go | |
parent | 2275fa7d0c75d20103f90b0e1616937d5a9fc5e6 (diff) | |
download | go-git-e1d8866ffa78fa16d2f39b0ba5344a7269ee5371.tar.gz |
clients and remote: fetch implementation
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) +} |