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/http/common_test.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/http/common_test.go')
-rw-r--r-- | plumbing/transport/http/common_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plumbing/transport/http/common_test.go b/plumbing/transport/http/common_test.go index 217999d..1fd0dd5 100644 --- a/plumbing/transport/http/common_test.go +++ b/plumbing/transport/http/common_test.go @@ -13,7 +13,8 @@ import ( func Test(t *testing.T) { TestingT(t) } type ClientSuite struct { - Endpoint transport.Endpoint + Endpoint transport.Endpoint + EmptyAuth transport.AuthMethod } var _ = Suite(&ClientSuite{}) @@ -76,9 +77,8 @@ func (s *ClientSuite) testNewHTTPError(c *C, code int, msg string) { func (s *ClientSuite) TestSetAuth(c *C) { auth := &BasicAuth{} - r, err := DefaultClient.NewUploadPackSession(s.Endpoint) + r, err := DefaultClient.NewUploadPackSession(s.Endpoint, auth) c.Assert(err, IsNil) - r.SetAuth(auth) c.Assert(auth, Equals, r.(*upSession).auth) } @@ -88,7 +88,6 @@ func (*mockAuth) Name() string { return "" } func (*mockAuth) String() string { return "" } func (s *ClientSuite) TestSetAuthWrongType(c *C) { - r, err := DefaultClient.NewUploadPackSession(s.Endpoint) - c.Assert(err, IsNil) - c.Assert(r.SetAuth(&mockAuth{}), Equals, transport.ErrInvalidAuthMethod) + _, err := DefaultClient.NewUploadPackSession(s.Endpoint, &mockAuth{}) + c.Assert(err, Equals, transport.ErrInvalidAuthMethod) } |