aboutsummaryrefslogblamecommitdiffstats
path: root/plumbing/transport/server/receive_pack_test.go
blob: de072f3adf953b67ff64dac91fe0094ceb760ac1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                   
                                                        





                              









                                             
                                





                                               

                                                                    
                                                                                    


                                                              
package server_test

import (
	"github.com/go-git/go-git/v5/plumbing/transport"

	. "gopkg.in/check.v1"
)

type ReceivePackSuite struct {
	BaseSuite
}

var _ = Suite(&ReceivePackSuite{})

func (s *ReceivePackSuite) SetUpSuite(c *C) {
	s.BaseSuite.SetUpSuite(c)
	s.ReceivePackSuite.Client = s.client
}

func (s *ReceivePackSuite) SetUpTest(c *C) {
	s.prepareRepositories(c)
}

func (s *ReceivePackSuite) TearDownTest(c *C) {
	s.Suite.TearDownSuite(c)
}

// Overwritten, server returns error earlier.
func (s *ReceivePackSuite) TestAdvertisedReferencesNotExists(c *C) {
	r, err := s.Client.NewReceivePackSession(s.NonExistentEndpoint, s.EmptyAuth)
	c.Assert(err, Equals, transport.ErrRepositoryNotFound)
	c.Assert(r, IsNil)
}