test

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All added in v1.0.0

func All(t *testing.T, tester DatastoreTester)

All runs all generic datastore tests on a DatastoreTester.

func DeletePreconditionsTest added in v1.0.0

func DeletePreconditionsTest(t *testing.T, tester DatastoreTester)

DeletePreconditionsTest tests whether or not the requirements for checking preconditions via DeleteRelationships hold for a particular datastore.

func DeleteRelationshipsTest added in v1.0.0

func DeleteRelationshipsTest(t *testing.T, tester DatastoreTester)

DeleteRelationshipsTest tests whether or not the requirements for deleting relationships hold for a particular datastore.

func InvalidReadsTest added in v1.0.0

func InvalidReadsTest(t *testing.T, tester DatastoreTester)

InvalidReadsTest tests whether or not the requirements for reading via invalid revisions hold for a particular datastore.

func NamespaceDeleteTest added in v1.0.0

func NamespaceDeleteTest(t *testing.T, tester DatastoreTester)

NamespaceDeleteTest tests whether or not the requirements for deleting namespaces hold for a particular datastore.

func NamespaceWriteTest added in v1.0.0

func NamespaceWriteTest(t *testing.T, tester DatastoreTester)

NamespaceWriteTest tests whether or not the requirements for writing namespaces hold for a particular datastore.

func RevisionFuzzingTest added in v1.0.0

func RevisionFuzzingTest(t *testing.T, tester DatastoreTester)

RevisionFuzzingTest tests whether or not the requirements for revisions hold for a particular datastore.

func SimpleTest added in v1.0.0

func SimpleTest(t *testing.T, tester DatastoreTester)

SimpleTest tests whether or not the requirements for simple reading and writing of relationships hold for a particular datastore.

func UsersetsTest added in v1.0.0

func UsersetsTest(t *testing.T, tester DatastoreTester)

UsersetsTest tests whether or not the requirements for reading usersets hold for a particular datastore.

func WatchCancelTest added in v1.0.0

func WatchCancelTest(t *testing.T, tester DatastoreTester)

WatchCancelTest tests whether or not the requirements for cancelling watches hold for a particular datastore.

func WatchTest added in v1.0.0

func WatchTest(t *testing.T, tester DatastoreTester)

WatchTest tests whether or not the requirements for watching changes hold for a particular datastore.

func WritePreconditionsTest added in v1.0.0

func WritePreconditionsTest(t *testing.T, tester DatastoreTester)

WritePreconditionsTest tests whether or not the requirements for checking preconditions via WriteTuples hold for a particular datastore.

Types

type DatastoreTester

type DatastoreTester interface {
	// New creates a new datastore instance for a single test.
	New(revisionFuzzingTimedelta, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error)
}

DatastoreTester provides a generic datastore suite a means of initializing a particular datastore.

type MockedCommonTupleQuery added in v1.1.0

type MockedCommonTupleQuery struct {
	mock.Mock
}

MockedCommonTupleQuery is a mock implementation of the common tuple query.

func (*MockedCommonTupleQuery) Execute added in v1.1.0

func (*MockedCommonTupleQuery) Limit added in v1.1.0

type MockedDatastore added in v1.1.0

type MockedDatastore struct {
	mock.Mock
}

MockedDatastore is a mock implementation of the datastore.

func (*MockedDatastore) CheckRevision added in v1.1.0

func (md *MockedDatastore) CheckRevision(ctx context.Context, revision datastore.Revision) error

func (*MockedDatastore) Close added in v1.1.0

func (md *MockedDatastore) Close() error

func (*MockedDatastore) DeleteNamespace added in v1.1.0

func (md *MockedDatastore) DeleteNamespace(ctx context.Context, nsName string) (datastore.Revision, error)

func (*MockedDatastore) DeleteRelationships added in v1.1.0

func (md *MockedDatastore) DeleteRelationships(ctx context.Context, preconditions []*v1.Precondition, filter *v1.RelationshipFilter) (datastore.Revision, error)

func (*MockedDatastore) IsReady added in v1.1.0

func (md *MockedDatastore) IsReady(ctx context.Context) (bool, error)

func (*MockedDatastore) ListNamespaces added in v1.1.0

func (md *MockedDatastore) ListNamespaces(ctx context.Context) ([]*v0.NamespaceDefinition, error)

func (*MockedDatastore) QueryTuples added in v1.1.0

func (*MockedDatastore) ReadNamespace added in v1.1.0

func (md *MockedDatastore) ReadNamespace(ctx context.Context, nsName string) (*v0.NamespaceDefinition, datastore.Revision, error)

func (*MockedDatastore) ReverseQueryTuplesFromSubject added in v1.1.0

func (md *MockedDatastore) ReverseQueryTuplesFromSubject(subject *v0.ObjectAndRelation, revision datastore.Revision) datastore.ReverseTupleQuery

func (*MockedDatastore) ReverseQueryTuplesFromSubjectNamespace added in v1.1.0

func (md *MockedDatastore) ReverseQueryTuplesFromSubjectNamespace(subjectNamespace string, revision datastore.Revision) datastore.ReverseTupleQuery

func (*MockedDatastore) ReverseQueryTuplesFromSubjectRelation added in v1.1.0

func (md *MockedDatastore) ReverseQueryTuplesFromSubjectRelation(subjectNamespace, subjectRelation string, revision datastore.Revision) datastore.ReverseTupleQuery

func (*MockedDatastore) Revision added in v1.1.0

func (md *MockedDatastore) Revision(ctx context.Context) (datastore.Revision, error)

func (*MockedDatastore) SyncRevision added in v1.1.0

func (md *MockedDatastore) SyncRevision(ctx context.Context) (datastore.Revision, error)

func (*MockedDatastore) Watch added in v1.1.0

func (md *MockedDatastore) Watch(ctx context.Context, afterRevision datastore.Revision) (<-chan *datastore.RevisionChanges, <-chan error)

func (*MockedDatastore) WriteNamespace added in v1.1.0

func (md *MockedDatastore) WriteNamespace(ctx context.Context, newConfig *v0.NamespaceDefinition) (datastore.Revision, error)

func (*MockedDatastore) WriteTuples added in v1.1.0

func (md *MockedDatastore) WriteTuples(ctx context.Context, preconditions []*v1.Precondition, updates []*v1.RelationshipUpdate) (datastore.Revision, error)

type MockedReverseTupleQuery added in v1.1.0

type MockedReverseTupleQuery struct {
	MockedCommonTupleQuery
}

MockedReverseTupleQuery is a mock implementation of the reverse tuple query.

func (*MockedReverseTupleQuery) WithObjectRelation added in v1.1.0

func (mrtq *MockedReverseTupleQuery) WithObjectRelation(namespace string, relation string) datastore.ReverseTupleQuery

type MockedTupleQuery added in v1.1.0

type MockedTupleQuery struct {
	MockedCommonTupleQuery
}

MockedTupleQuery is a mock implementation of the tuple query.

func (*MockedTupleQuery) WithSubjectFilter added in v1.1.0

func (mtq *MockedTupleQuery) WithSubjectFilter(filter *v1.SubjectFilter) datastore.TupleQuery

func (*MockedTupleQuery) WithUsersets added in v1.1.0

func (mtq *MockedTupleQuery) WithUsersets(usersets []*v0.ObjectAndRelation) datastore.TupleQuery

Jump to

Keyboard shortcuts

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