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/server_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/server_test.go')
-rw-r--r-- | plumbing/transport/server/server_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plumbing/transport/server/server_test.go b/plumbing/transport/server/server_test.go index 0f7201c..7912768 100644 --- a/plumbing/transport/server/server_test.go +++ b/plumbing/transport/server/server_test.go @@ -20,12 +20,18 @@ type BaseSuite struct { loader server.MapLoader client transport.Transport clientBackup transport.Transport + asClient bool } func (s *BaseSuite) SetUpSuite(c *C) { s.Suite.SetUpSuite(c) s.loader = server.MapLoader{} - s.client = server.NewServer(s.loader) + if s.asClient { + s.client = server.NewClient(s.loader) + } else { + s.client = server.NewServer(s.loader) + } + s.clientBackup = client.Protocols["file"] client.Protocols["file"] = s.client } |