aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file/fetch_pack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/file/fetch_pack_test.go')
-rw-r--r--plumbing/transport/file/fetch_pack_test.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/plumbing/transport/file/fetch_pack_test.go b/plumbing/transport/file/fetch_pack_test.go
new file mode 100644
index 0000000..80f11ee
--- /dev/null
+++ b/plumbing/transport/file/fetch_pack_test.go
@@ -0,0 +1,48 @@
+package file
+
+import (
+ "fmt"
+ "os/exec"
+
+ "gopkg.in/src-d/go-git.v4/fixtures"
+ "gopkg.in/src-d/go-git.v4/plumbing/transport"
+ "gopkg.in/src-d/go-git.v4/plumbing/transport/test"
+
+ . "gopkg.in/check.v1"
+)
+
+type FetchPackSuite struct {
+ fixtures.Suite
+ test.FetchPackSuite
+}
+
+var _ = Suite(&FetchPackSuite{})
+
+func (s *FetchPackSuite) SetUpSuite(c *C) {
+ s.Suite.SetUpSuite(c)
+
+ if err := exec.Command("git", "--version").Run(); err != nil {
+ c.Skip("git command not found")
+ }
+
+ s.FetchPackSuite.Client = DefaultClient
+
+ fixture := fixtures.Basic().One()
+ path := fixture.DotGit().Base()
+ url := fmt.Sprintf("file://%s", path)
+ ep, err := transport.NewEndpoint(url)
+ c.Assert(err, IsNil)
+ s.Endpoint = ep
+
+ fixture = fixtures.ByTag("empty").One()
+ path = fixture.DotGit().Base()
+ url = fmt.Sprintf("file://%s", path)
+ ep, err = transport.NewEndpoint(url)
+ c.Assert(err, IsNil)
+ s.EmptyEndpoint = ep
+
+ url = fmt.Sprintf("file://%s/%s", fixtures.DataFolder, "non-existent")
+ ep, err = transport.NewEndpoint(url)
+ c.Assert(err, IsNil)
+ s.NonExistentEndpoint = ep
+}