tests

package
v0.0.0-...-383e6fc Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package tests are different utilities used for testing DRLM Core

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCfg

func GenerateCfg(t *testing.T, ctx *context.Context)

GenerateCfg creates a configuration file with the default values

func GenerateCtx

func GenerateCtx() *context.Context

GenerateCtx generates a

func GenerateDB

func GenerateDB(t *testing.T, ctx *context.Context) sqlmock.Sqlmock

GenerateDB generates a new Mock DB

func GenerateMinio

func GenerateMinio(ctx *context.Context, f http.Handler) *httptest.Server

GenerateMinio generates a test minio server

Types

type AgentConnectionServerMock

type AgentConnectionServerMock struct {
	mock.Mock
}

AgentConnectionServerMock is a mock for the Agent Connection gRPC server

func (*AgentConnectionServerMock) Context

Context mocks the grpc.ServerStream Context method

func (*AgentConnectionServerMock) Recv

Recv mocks the AgentConnnectionServer Recv method

func (*AgentConnectionServerMock) RecvMsg

func (a *AgentConnectionServerMock) RecvMsg(m interface{}) error

RecvMsg mocks the grpc.ServerStream RecvMsg method

func (*AgentConnectionServerMock) Send

Send mocks the AgentConnectionServer Send method

func (*AgentConnectionServerMock) SendHeader

func (a *AgentConnectionServerMock) SendHeader(metadata.MD) error

SendHeader mocks the grpc.ServerStream SendHeader method

func (*AgentConnectionServerMock) SendMsg

func (a *AgentConnectionServerMock) SendMsg(m interface{}) error

SendMsg mocks the grpc.ServerStream SendMsg method

func (*AgentConnectionServerMock) SetHeader

SetHeader mocks the grpc.ServerStream SetHeader method

func (*AgentConnectionServerMock) SetTrailer

func (a *AgentConnectionServerMock) SetTrailer(metadata.MD)

SetTrailer mocks the grpc.ServerStream SetTrailer method

type DBAnyBucketName

type DBAnyBucketName struct{}

DBAnyBucketName is used to mock bucket names (since they have a UID part)

func (DBAnyBucketName) Match

func (b DBAnyBucketName) Match(v driver.Value) bool

Match is the function responsible for returning whether the mock expression matches or not the expectations

type DBAnyEncryptedPassword

type DBAnyEncryptedPassword struct{}

DBAnyEncryptedPassword is used to mock encrypted passwords using bcrypt

func (DBAnyEncryptedPassword) Match

Match is the function responsible for returning whether the mock expression matches or not the expectations

type DBAnySecret

type DBAnySecret struct{}

DBAnySecret is used to mock a secret

func (DBAnySecret) Match

func (b DBAnySecret) Match(v driver.Value) bool

Match is the function responsible for returning whether the mock expression matches or not the expectations

type DBAnyTime

type DBAnyTime struct{}

DBAnyTime is used to mock time.Time in the DB

func (DBAnyTime) Match

func (a DBAnyTime) Match(v driver.Value) bool

Match is the function responsible for returning whether the mock expression matches or not the expectations

Jump to

Keyboard shortcuts

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