integration

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertIDSet

func AssertIDSet(t *testing.T, got, expected []string)

AssertIDSet checks that two sets of fixture node IDs match (order-independent).

func AssertPaths

func AssertPaths(t *testing.T, paths []graph.Path, idMap opengraph.IDMap, expected [][]string)

AssertPaths checks that the returned paths match the expected set of fixture node ID sequences. Each expected path is a slice of fixture node IDs, e.g. []string{"a", "b", "d"}. Pass nil for expected when no paths should be returned.

func ClearGraph

func ClearGraph(t *testing.T, db graph.Database, ctx context.Context)

ClearGraph deletes all nodes (and cascading edges) from the database.

func LoadDataset

func LoadDataset(t *testing.T, db graph.Database, ctx context.Context, name string) opengraph.IDMap

LoadDataset loads a named JSON dataset from testdata/ and returns the ID mapping.

func QueryNodeIDs

func QueryNodeIDs(t *testing.T, ctx context.Context, db graph.Database, cypher string, idMap opengraph.IDMap) []string

QueryNodeIDs runs a Cypher query that returns nodes and collects their fixture IDs. Duplicate nodes are deduplicated.

func QueryPaths

func QueryPaths(t *testing.T, ctx context.Context, db graph.Database, cypher string) []graph.Path

QueryPaths runs a Cypher query and collects all returned paths.

func SetupDB

func SetupDB(t *testing.T, datasets ...string) (graph.Database, context.Context)

SetupDB opens a database connection for the selected driver, asserts a schema derived from the given datasets, and registers cleanup. Returns the database and a background context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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