Documentation ¶
Overview ¶
Package repotesting contains test utilities for working with repositories.
Index ¶
- type Environment
- func (e *Environment) Close(ctx context.Context, t *testing.T)
- func (e *Environment) MustConnectOpenAnother(t *testing.T, openOpts ...func(*repo.Options)) repo.Repository
- func (e *Environment) MustOpenAnother(t *testing.T) repo.Repository
- func (e *Environment) MustReopen(t *testing.T, openOpts ...func(*repo.Options))
- func (e *Environment) Setup(t *testing.T, opts ...Options) *Environment
- func (e *Environment) VerifyBlobCount(t *testing.T, want int)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct { Repository *repo.DirectRepository // contains filtered or unexported fields }
Environment encapsulates details of a test environment.
func (*Environment) Close ¶
func (e *Environment) Close(ctx context.Context, t *testing.T)
Close closes testing environment.
func (*Environment) MustConnectOpenAnother ¶ added in v0.7.0
func (e *Environment) MustConnectOpenAnother(t *testing.T, openOpts ...func(*repo.Options)) repo.Repository
MustConnectOpenAnother opens another repository backend by the same storage, with independent config and cache options.
func (*Environment) MustOpenAnother ¶ added in v0.6.0
func (e *Environment) MustOpenAnother(t *testing.T) repo.Repository
MustOpenAnother opens another repository backend by the same storage.
func (*Environment) MustReopen ¶
func (e *Environment) MustReopen(t *testing.T, openOpts ...func(*repo.Options))
MustReopen closes and reopens the repository.
func (*Environment) Setup ¶
func (e *Environment) Setup(t *testing.T, opts ...Options) *Environment
Setup sets up a test environment.
func (*Environment) VerifyBlobCount ¶
func (e *Environment) VerifyBlobCount(t *testing.T, want int)
VerifyBlobCount verifies that the underlying storage contains the specified number of blobs.
Click to show internal directories.
Click to hide internal directories.