dbtest

package
v0.1.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() *zerolog.Logger

func SetupCreateDeviceDefinition

func SetupCreateDeviceDefinition(t *testing.T, dm models.DeviceMake, model string, year int, pdb db.Store) *models.DeviceDefinition

func SetupCreateDeviceIntegration

func SetupCreateDeviceIntegration(t *testing.T, dd *models.DeviceDefinition, integrationID string, pdb db.Store) *models.DeviceIntegration

func SetupCreateMake

func SetupCreateMake(t *testing.T, mk string, pdb db.Store) models.DeviceMake

func SetupCreateSmartCarIntegration

func SetupCreateSmartCarIntegration(t *testing.T, pdb db.Store) *models.Integration

func SetupCreateStyle

func SetupCreateStyle(t *testing.T, deviceDefinitionID string, name string, source string, subModel string, pdb db.Store) models.DeviceStyle

func StartContainerDatabase

func StartContainerDatabase(ctx context.Context, dbName string, t *testing.T, migrationsDirRelPath string) (db.Store, testcontainers.Container)

StartContainerDatabase starts postgres container with default test settings, and migrates the db. Caller must terminate container.

func TruncateTables

func TruncateTables(db *sql.DB, t *testing.T)

TruncateTables truncates tables for the test db, useful to run as teardown at end of each DB dependent test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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