mock

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

The mock package provides implementations of dutctl entities that can be used for unit-testing modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	PrintCalled           bool
	PrintText             string
	ConsoleCalled         bool
	Stdin                 io.Reader
	Stdout                io.Writer
	Stderr                io.Writer
	RequestFileCalled     bool
	RequestedFileName     string
	RequestedFileResponse io.Reader
	SendFileCalled        bool
	SentFileName          string
	SentFileContent       []byte
}

Session is a mock implementation of the module.Session interface for testing purposes.

func (*Session) Console

func (m *Session) Console() (stdin io.Reader, stdout, stderr io.Writer)

func (*Session) Print

func (m *Session) Print(text string)

func (*Session) RequestFile

func (m *Session) RequestFile(name string) (io.Reader, error)

func (*Session) SendFile

func (m *Session) SendFile(name string, r io.Reader) error

Jump to

Keyboard shortcuts

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