testutil

package
v0.10.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TestChannelPoint1 = TestFundingTransactionHash1 + ":3"
View Source
const TestChannelPoint2 = TestFundingTransactionHash2 + ":3"
View Source
const TestChannelPoint3 = TestFundingTransactionHash3 + ":3"
View Source
const TestChannelPoint4 = TestFundingTransactionHash4 + ":3"
View Source
const TestChannelPoint5_NOTINDB = TestFundingTransactionHash5_NOTINDB + ":3"
View Source
const TestFundingTransactionHash1 = "0101010101010101010101010101010101010101010101010101010101010101"
View Source
const TestFundingTransactionHash2 = "0101010101010101010101010101010101010101010101010101010101010102"
View Source
const TestFundingTransactionHash3 = "0101010101010101010101010101010101010101010101010101010101010103"
View Source
const TestFundingTransactionHash4 = "0101010101010101010101010101010101010101010101010101010101010104"
View Source
const TestFundingTransactionHash5_NOTINDB = "0101010101010101010101010101010101010101010101010101010101010105"
View Source
const TestPublicKey1 = "PublicKey1"
View Source
const TestPublicKey2 = "PublicKey2"

Variables

This section is empty.

Functions

func Errorf

func Errorf(t *testing.T, txt string, a ...interface{})

func Fatalf

func Fatalf(t *testing.T, txt string, a ...interface{})

func Given

func Given(t *testing.T, txt string)

func GivenF

func GivenF(t *testing.T, txt string, a ...interface{})

func Successf

func Successf(t *testing.T, txt string, a ...interface{})

func WhenF

func WhenF(t *testing.T, txt string, a ...interface{})

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

A Server represents a running PostgreSQL server.

func InitTestDBConn

func InitTestDBConn() (*Server, error)

InitTestDBConn creates a connection to the postgres user and creates the Server struct. This is used to create all other test databases and should be executed once at the top of a test file (in the Main function).

func (*Server) Cleanup

func (srv *Server) Cleanup() error

Cleanup closes the connection to the connection to the postgres server used to create new test databases. This should only be used once for each test file.

func (*Server) NewTestDatabase

func (srv *Server) NewTestDatabase(migrate bool) (*sqlx.DB, context.CancelFunc, error)

NewTestDatabase opens a connection to a freshly created database on the server.

Jump to

Keyboard shortcuts

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