aboutsummaryrefslogtreecommitdiffstats
path: root/clients/http/git_upload_pack_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-10-23 00:34:40 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2015-10-23 00:34:40 +0200
commitb359f11ea09e642695edcd114b463da4395b10c1 (patch)
tree6f84c4693429a3815b7523e957801cdb420abb40 /clients/http/git_upload_pack_test.go
parent6f43e8933ba3c04072d5d104acc6118aac3e52ee (diff)
downloadgo-git-b359f11ea09e642695edcd114b463da4395b10c1.tar.gz
clients: supporting diferent protocols
Diffstat (limited to 'clients/http/git_upload_pack_test.go')
-rw-r--r--clients/http/git_upload_pack_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/clients/http/git_upload_pack_test.go b/clients/http/git_upload_pack_test.go
new file mode 100644
index 0000000..b478445
--- /dev/null
+++ b/clients/http/git_upload_pack_test.go
@@ -0,0 +1,32 @@
+package http
+
+import . "gopkg.in/check.v1"
+
+type SuiteRemote struct{}
+
+var _ = Suite(&SuiteRemote{})
+
+const RepositoryFixture = "https://github.com/tyba/git-fixture"
+
+func (s *SuiteRemote) TestConnect(c *C) {
+ r := NewGitUploadPackService()
+ c.Assert(r.Connect(RepositoryFixture), IsNil)
+}
+
+func (s *SuiteRemote) TestDefaultBranch(c *C) {
+ r := NewGitUploadPackService()
+ c.Assert(r.Connect(RepositoryFixture), IsNil)
+
+ info, err := r.Info()
+ c.Assert(err, IsNil)
+ c.Assert(info.Capabilities.SymbolicReference("HEAD"), Equals, "refs/heads/master")
+}
+
+func (s *SuiteRemote) TestCapabilities(c *C) {
+ r := NewGitUploadPackService()
+ c.Assert(r.Connect(RepositoryFixture), IsNil)
+
+ info, err := r.Info()
+ c.Assert(err, IsNil)
+ c.Assert(info.Capabilities.Get("agent"), HasLen, 1)
+}