diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-05 19:08:20 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-05 20:55:46 +0100 |
commit | 6be0bc1233b1a31e749354f1d54104b49d5bf19b (patch) | |
tree | a9fd259944a42322050247ed6b5393150f2c4cb8 /clients/http/git_upload_pack_test.go | |
parent | a80d56b21142096f458758405736f3d567c175f5 (diff) | |
download | go-git-6be0bc1233b1a31e749354f1d54104b49d5bf19b.tar.gz |
clients: new AuthMethod and ConnectWithAuth
Diffstat (limited to 'clients/http/git_upload_pack_test.go')
-rw-r--r-- | clients/http/git_upload_pack_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clients/http/git_upload_pack_test.go b/clients/http/git_upload_pack_test.go index b870259..02ed37c 100644 --- a/clients/http/git_upload_pack_test.go +++ b/clients/http/git_upload_pack_test.go @@ -19,6 +19,23 @@ func (s *SuiteRemote) TestConnect(c *C) { c.Assert(r.Connect(RepositoryFixture), IsNil) } +func (s *SuiteRemote) TestConnectWithAuth(c *C) { + auth := &BasicAuth{} + r := NewGitUploadPackService() + c.Assert(r.ConnectWithAuth(RepositoryFixture, auth), IsNil) + c.Assert(r.auth, Equals, auth) +} + +type mockAuth struct{} + +func (*mockAuth) Name() string { return "" } +func (*mockAuth) String() string { return "" } + +func (s *SuiteRemote) TestConnectWithAuthWrongType(c *C) { + r := NewGitUploadPackService() + c.Assert(r.ConnectWithAuth(RepositoryFixture, &mockAuth{}), Equals, InvalidAuthMethodErr) +} + func (s *SuiteRemote) TestDefaultBranch(c *C) { r := NewGitUploadPackService() c.Assert(r.Connect(RepositoryFixture), IsNil) |