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.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)
+}