diff options
author | Santiago M. Mola <santi@mola.io> | 2017-07-11 14:51:12 +0200 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-07-11 15:07:09 +0200 |
commit | 8009cde25dda59ff13a97fabac9abb0b6ef57ef9 (patch) | |
tree | bb55566bb72e9c871ac92d1697005badadd5e5d6 /plumbing/transport/server/upload_pack_test.go | |
parent | 09cd5ccfd384be79e8c49d0d0bccd22589098809 (diff) | |
download | go-git-8009cde25dda59ff13a97fabac9abb0b6ef57ef9.tar.gz |
transport/server: add NewClient
server.NewClient returns a server that acts as a client.
This makes it working seamlessly when registering a server directly with
`client.InstallProtocol`.
Diffstat (limited to 'plumbing/transport/server/upload_pack_test.go')
-rw-r--r-- | plumbing/transport/server/upload_pack_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plumbing/transport/server/upload_pack_test.go b/plumbing/transport/server/upload_pack_test.go index 137f887..bd2b791 100644 --- a/plumbing/transport/server/upload_pack_test.go +++ b/plumbing/transport/server/upload_pack_test.go @@ -38,3 +38,20 @@ func (s *UploadPackSuite) TestAdvertisedReferencesNotExists(c *C) { c.Assert(err, Equals, transport.ErrRepositoryNotFound) c.Assert(r, IsNil) } + +// Tests server with `asClient = true`. This is recommended when using a server +// registered directly with `client.InstallProtocol`. +type ClientLikeUploadPackSuite struct { + UploadPackSuite +} + +var _ = Suite(&ClientLikeUploadPackSuite{}) + +func (s *ClientLikeUploadPackSuite) SetUpSuite(c *C) { + s.asClient = true + s.UploadPackSuite.SetUpSuite(c) +} + +func (s *ClientLikeUploadPackSuite) TestAdvertisedReferencesEmpty(c *C) { + s.UploadPackSuite.UploadPackSuite.TestAdvertisedReferencesEmpty(c) +} |