aboutsummaryrefslogtreecommitdiffstats
path: root/clients/http/git_upload_pack_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-11-05 19:08:20 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-11-05 20:55:46 +0100
commit6be0bc1233b1a31e749354f1d54104b49d5bf19b (patch)
treea9fd259944a42322050247ed6b5393150f2c4cb8 /clients/http/git_upload_pack_test.go
parenta80d56b21142096f458758405736f3d567c175f5 (diff)
downloadgo-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.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)