testmode

package
v1.0.0-beta.43 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package testmode provides functions to set special modes for tests, allowing to use actual Postgres or SQLite file for testing, especially for development purposes. Important: It should be used only in LOCAL tests. Calls of SetPostgresMode and SetFileSQLiteMode should not be committed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileSQLiteMode

func CheckFileSQLiteMode() bool

CheckFileSQLiteMode checks if the test mode is set to use SQLite file

func CheckPostgresMode

func CheckPostgresMode() (ok bool, dbName string)

CheckPostgresMode checks if the test mode is set to use actual Postgres and returns the database name.

func DevelopmentOnly_SetFileSQLiteMode

func DevelopmentOnly_SetFileSQLiteMode(t testing.TB)

DevelopmentOnly_SetFileSQLiteMode sets the test mode to use SQLite file

func DevelopmentOnly_SetPostgresMode

func DevelopmentOnly_SetPostgresMode(t testing.TB)

DevelopmentOnly_SetPostgresMode sets the test mode to use actual Postgres and sets the database name.

func DevelopmentOnly_SetPostgresModeWithName

func DevelopmentOnly_SetPostgresModeWithName(t testing.TB, dbName string)

DevelopmentOnly_SetPostgresModeWithName sets the test mode to use actual Postgres and sets the database name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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