fake

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitData

func GitData(path string) (string, error)

GitData mocks a git file content based on a given filepath

func GitilesData

func GitilesData(path string) (*gitiles.DownloadFileResponse, error)

func SheetData

func SheetData(path string) (*sheets.Spreadsheet, error)

SheetData returns the fake sheet get API response for other testers

Types

type DeviceConfigClient

type DeviceConfigClient struct {
}

DeviceConfigClient is a fake impl for testing

func (*DeviceConfigClient) DeviceConfigsExists

func (c *DeviceConfigClient) DeviceConfigsExists(ctx context.Context, cfgIDs []*deviceconfig.ConfigId) ([]bool, error)

DeviceConfigsExists detects whether any number of configs exist. The return is an array of booleans, where the ith boolean represents the existence of the ith config.

func (*DeviceConfigClient) GetDeviceConfig

func (c *DeviceConfigClient) GetDeviceConfig(ctx context.Context, cfgID *deviceconfig.ConfigId) (*deviceconfig.Config, error)

GetDeviceConfig fetches a specific device config.

type GitClient

type GitClient struct {
}

GitClient mocks the git.ClientInterface

func (*GitClient) GetFile

func (gc *GitClient) GetFile(ctx context.Context, path string) (string, error)

GetFile mocks git.ClientInterface.GetFile()

func (*GitClient) SwitchProject

func (gc *GitClient) SwitchProject(ctx context.Context, project string) error

SwitchProject mocks git.ClientInterface.SwitchProject()

type GitTilesClient

type GitTilesClient struct {
}

GitTilesClient mocks the gitiles.GitilesClient

func (*GitTilesClient) DownloadFile

func (*GitTilesClient) Log

func (gc *GitTilesClient) Log(ctx context.Context, req *gitiles.LogRequest, opts ...grpc.CallOption) (res *gitiles.LogResponse, err error)

Log mocks gitiles.GitilesClient.Log()

type HwidClient

type HwidClient struct {
}

HwidClient mocks the hwid.ClientInterface

func (*HwidClient) QueryHwid

func (hc *HwidClient) QueryHwid(ctx context.Context, hwid string) (*ufspb.DutLabel, error)

QueryHwid mocks hwid.ClientInterface.QueryHwid()

type SheetClient

type SheetClient struct {
}

SheetClient mocks the sheet.ClientInterface

func (*SheetClient) Get

func (sc *SheetClient) Get(ctx context.Context, sheetID string, ranges []string) (*sheets.Spreadsheet, error)

Get mocks the sheet.ClientInterface.Get()

Jump to

Keyboard shortcuts

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