testutils

package
v0.0.0-...-97dfe3f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestFile

func CreateTestFile(dir string, fileName string) *os.File

Create test file

func ReadAndAssertLines

func ReadAndAssertLines(t *testing.T, subscriber observer.Subscriber, logLine string, nLines int, done chan bool)

Reads lines from subscriber channel, asserts correct number, then sends true to bool channel. Should be used with timeout as it will just hang if not enough records are received.

func SleepThenWriteToFile

func SleepThenWriteToFile(file *os.File, duration time.Duration, nLines int, testLine string)

Sleeps then writes to provided file

Types

type MockConnector

type MockConnector struct{}

Mock Connector implementing ConnectorInterface

func (MockConnector) Close

func (c MockConnector) Close() error

func (MockConnector) GetName

func (c MockConnector) GetName() string

func (MockConnector) Send

func (c MockConnector) Send(t *tail.Line) error

Jump to

Keyboard shortcuts

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