Documentation ¶
Index ¶
- Constants
- func ClearTestDatabase(ctx context.Context, db *database.Database)
- func MatchGroupBase(addFields ...gstruct.Fields) gomega.OmegaMatcher
- func MatchGroupBasePtr(addFields ...gstruct.Fields) gomega.OmegaMatcher
- func MatchGroupBasePtrPhotoCounts(counts PhotoCounts, rawDescCounts PhotoCounts) gomega.OmegaMatcher
- func MatchUnorderedSlice(elems ...interface{}) gomega.OmegaMatcher
- func MatchVisibilityTokens(rawTokens ...docs.VisibilityTokenValue) gomega.OmegaMatcher
- func NewTestDb() *mongo.Database
- type PhotoCounts
Constants ¶
const DatabaseName = "lookoutpoint-test"
DatabaseName of the test database
const MongoDBURI = "mongodb://localhost:27017/?retryWrites=false"
MongoDBURI assumes we're running mongod locally
Variables ¶
This section is empty.
Functions ¶
func ClearTestDatabase ¶
ClearTestDatabase clears the provided database
func MatchGroupBase ¶
func MatchGroupBase(addFields ...gstruct.Fields) gomega.OmegaMatcher
MatchGroupBase is a helper function to create a matcher to match a struct with an embedded docs.GroupBase member.
func MatchGroupBasePtr ¶
func MatchGroupBasePtr(addFields ...gstruct.Fields) gomega.OmegaMatcher
MatchGroupBasePtr is the same as MatchGroupbase except that it matches gainst a pointer to a struct
func MatchGroupBasePtrPhotoCounts ¶
func MatchGroupBasePtrPhotoCounts(counts PhotoCounts, rawDescCounts PhotoCounts) gomega.OmegaMatcher
MatchGroupBasePtrPhotoCounts checks visibility tokens and visibility token counts based on the provided self photo counts and descendant photo counts.
func MatchUnorderedSlice ¶
func MatchUnorderedSlice(elems ...interface{}) gomega.OmegaMatcher
MatchUnorderedSlice is a helper to match against a slice with arbitrary ordering of elements
func MatchVisibilityTokens ¶
func MatchVisibilityTokens(rawTokens ...docs.VisibilityTokenValue) gomega.OmegaMatcher
MatchVisibilityTokens creates a matcher against a VisibilityTokens field in a pointer to a struct. The visibility tokens field is assumed to be a slice and the tokens are matched as a set (i.e. order does not matter). Automatically adds a VisTokenAll.
Types ¶
type PhotoCounts ¶
type PhotoCounts map[docs.VisibilityTokenValue]int
PhotoCounts is a map of visibility token values to photo counts. Use with MatchGroupBasePtrPhotoCounts.