diff options
author | Anthony Weems <amlweems@gmail.com> | 2017-01-17 11:17:11 -0600 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-01-17 18:17:11 +0100 |
commit | 6593c757346f9817a770ff0ea091cce3e8243070 (patch) | |
tree | 6fbb72583931b0386e382177970650a9cdbca4eb /plumbing/transport/test/upload_pack.go | |
parent | 241e8ba00ac9533299d62dc38684305af2b6c301 (diff) | |
download | go-git-6593c757346f9817a770ff0ea091cce3e8243070.tar.gz |
transport: remove SetAuth, fixes #206 (#210)
* remove SetAuth functions, implement at NewUploadPackSession/NewReceivePackSession level.
* propagate transport.Auth from Fetch/Pull/Clone options to the transport API.
Diffstat (limited to 'plumbing/transport/test/upload_pack.go')
-rw-r--r-- | plumbing/transport/test/upload_pack.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/plumbing/transport/test/upload_pack.go b/plumbing/transport/test/upload_pack.go index 5af4b29..c1a9050 100644 --- a/plumbing/transport/test/upload_pack.go +++ b/plumbing/transport/test/upload_pack.go @@ -22,11 +22,12 @@ type UploadPackSuite struct { Endpoint transport.Endpoint EmptyEndpoint transport.Endpoint NonExistentEndpoint transport.Endpoint + EmptyAuth transport.AuthMethod Client transport.Transport } func (s *UploadPackSuite) TestAdvertisedReferencesEmpty(c *C) { - r, err := s.Client.NewUploadPackSession(s.EmptyEndpoint) + r, err := s.Client.NewUploadPackSession(s.EmptyEndpoint, s.EmptyAuth) c.Assert(err, IsNil) ar, err := r.AdvertisedReferences() c.Assert(err, Equals, transport.ErrEmptyRemoteRepository) @@ -34,13 +35,13 @@ func (s *UploadPackSuite) TestAdvertisedReferencesEmpty(c *C) { } func (s *UploadPackSuite) TestAdvertisedReferencesNotExists(c *C) { - r, err := s.Client.NewUploadPackSession(s.NonExistentEndpoint) + r, err := s.Client.NewUploadPackSession(s.NonExistentEndpoint, s.EmptyAuth) c.Assert(err, IsNil) ar, err := r.AdvertisedReferences() c.Assert(err, Equals, transport.ErrRepositoryNotFound) c.Assert(ar, IsNil) - r, err = s.Client.NewUploadPackSession(s.NonExistentEndpoint) + r, err = s.Client.NewUploadPackSession(s.NonExistentEndpoint, s.EmptyAuth) c.Assert(err, IsNil) req := packp.NewUploadPackRequest() req.Wants = append(req.Wants, plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) @@ -50,7 +51,7 @@ func (s *UploadPackSuite) TestAdvertisedReferencesNotExists(c *C) { } func (s *UploadPackSuite) TestCallAdvertisedReferenceTwice(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) ar1, err := r.AdvertisedReferences() c.Assert(err, IsNil) @@ -61,7 +62,7 @@ func (s *UploadPackSuite) TestCallAdvertisedReferenceTwice(c *C) { } func (s *UploadPackSuite) TestDefaultBranch(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -73,7 +74,7 @@ func (s *UploadPackSuite) TestDefaultBranch(c *C) { } func (s *UploadPackSuite) TestAdvertisedReferencesFilterUnsupported(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -83,7 +84,7 @@ func (s *UploadPackSuite) TestAdvertisedReferencesFilterUnsupported(c *C) { } func (s *UploadPackSuite) TestCapabilities(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -93,7 +94,7 @@ func (s *UploadPackSuite) TestCapabilities(c *C) { } func (s *UploadPackSuite) TestFullUploadPack(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -111,7 +112,7 @@ func (s *UploadPackSuite) TestFullUploadPack(c *C) { } func (s *UploadPackSuite) TestUploadPack(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -125,7 +126,7 @@ func (s *UploadPackSuite) TestUploadPack(c *C) { } func (s *UploadPackSuite) TestUploadPackInvalidReq(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -139,7 +140,7 @@ func (s *UploadPackSuite) TestUploadPackInvalidReq(c *C) { } func (s *UploadPackSuite) TestUploadPackNoChanges(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -153,7 +154,7 @@ func (s *UploadPackSuite) TestUploadPackNoChanges(c *C) { } func (s *UploadPackSuite) TestUploadPackMulti(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() @@ -168,7 +169,7 @@ func (s *UploadPackSuite) TestUploadPackMulti(c *C) { } func (s *UploadPackSuite) TestFetchError(c *C) { - r, err := s.Client.NewUploadPackSession(s.Endpoint) + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) req := packp.NewUploadPackRequest() |