apitest

package
v0.4.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Email    = "test@user.com"
	Password = "password"
	Name     = "Test User"
)

Variables

This section is empty.

Functions

func AssertCommitsPersisted

func AssertCommitsPersisted(t *testing.T, db objects.Store, commits [][]byte)

func CopyCommitsToNewStore

func CopyCommitsToNewStore(t *testing.T, src, dst objects.Store, commits [][]byte)

func CreateRandomCommit

func CreateRandomCommit(t *testing.T, db objects.Store, numCols, numRows int, parents [][]byte) ([]byte, *objects.Commit)

func FetchObjects

func FetchObjects(t *testing.T, db objects.Store, rs ref.Store, c *apiclient.Client, advertised [][]byte, havesPerRoundTrip int, opts ...apiclient.RequestOption) [][]byte

func PushObjects

func PushObjects(t *testing.T, db objects.Store, rs ref.Store, c *apiclient.Client, updates map[string]*payload.Update, remoteRefs map[string][]byte, maxPackfileSize uint64, opts ...apiclient.RequestOption) map[string]*payload.Update

func ReceivePackConfig

func ReceivePackConfig(denyNonFastForwards, denyDeletes bool) *conf.Config

Types

type GZIPAwareHandler added in v0.3.11

type GZIPAwareHandler struct {
	T           *testing.T
	Handler     http.Handler
	HandlerFunc http.HandlerFunc
}

func (*GZIPAwareHandler) ServeHTTP added in v0.3.11

func (h *GZIPAwareHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type RequestCaptureMiddleware added in v0.4.0

type RequestCaptureMiddleware struct {
	// contains filtered or unexported fields
}

func NewRequestCaptureMiddleware added in v0.4.0

func NewRequestCaptureMiddleware(handler http.Handler) *RequestCaptureMiddleware

func (*RequestCaptureMiddleware) Capture added in v0.4.0

func (m *RequestCaptureMiddleware) Capture(t *testing.T, f func(header http.Header)) *http.Request

func (*RequestCaptureMiddleware) ServeHTTP added in v0.4.0

type Server added in v0.4.0

type Server struct {
	// contains filtered or unexported fields
}

func NewServer added in v0.4.0

func NewServer(t *testing.T, rootPath *regexp.Regexp, opts ...apiserver.ServerOption) *Server

func (*Server) GetAuthnS added in v0.4.0

func (s *Server) GetAuthnS(repo string) auth.AuthnStore

func (*Server) GetAuthzS added in v0.4.0

func (s *Server) GetAuthzS(repo string) auth.AuthzStore

func (*Server) GetConfS added in v0.4.0

func (s *Server) GetConfS(repo string) conf.Store

func (*Server) GetDB added in v0.4.0

func (s *Server) GetDB(repo string) objects.Store

func (*Server) GetRS added in v0.4.0

func (s *Server) GetRS(repo string) ref.Store

func (*Server) GetRpSessions added in v0.4.0

func (s *Server) GetRpSessions(repo string) apiserver.ReceivePackSessionStore

func (*Server) GetUpSessions added in v0.4.0

func (s *Server) GetUpSessions(repo string) apiserver.UploadPackSessionStore

func (*Server) NewClient added in v0.4.0

func (s *Server) NewClient(t *testing.T, authenticate bool, pathPrefix string, pathPrefixPat *regexp.Regexp) (string, *apiclient.Client, *RequestCaptureMiddleware, func())

func (*Server) NewRemote added in v0.4.0

func (s *Server) NewRemote(t *testing.T, authenticate bool, pathPrefix string, pathPrefixPat *regexp.Regexp) (repo string, url string, m *RequestCaptureMiddleware, cleanup func())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL