aboutsummaryrefslogtreecommitdiffstats
path: root/clients/http/git_upload_pack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'clients/http/git_upload_pack_test.go')
-rw-r--r--clients/http/git_upload_pack_test.go17
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)