treetest

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package treetest implements fake Tree for testing in CV.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	// TreeStatus represents the current status of this fake Tree.
	TreeStatus tree.Status
	// Error forces FetchLatest to fail when set.
	Error error
	// contains filtered or unexported fields
}

Fake simulates Tree status app in test.

func NewFake

func NewFake(ctx context.Context, state tree.State) *Fake

NewFake returns a fake Tree.

func (*Fake) Client

func (f *Fake) Client() tree.Client

Client returns a client of this Fake Tree.

func (*Fake) InjectErr

func (f *Fake) InjectErr(err error)

InjectErr causes Fake tree status app to return error.

Passing nil error will bring tree status app to normal.

func (*Fake) ModifyState

func (f *Fake) ModifyState(ctx context.Context, newState tree.State)

ModifyState changes the state of this fake Tree.

Jump to

Keyboard shortcuts

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