testutil

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidUser = &user.User{HomeDir: "/home/foo", Username: "foo"}

ValidUser is a shared test fixture representing a valid OS user.

Functions

This section is empty.

Types

type MockUserLookup

type MockUserLookup struct {
	// User is returned on any call to Lookup() if Error is nil.
	User *user.User
	// Error, if non-nil, is returned on any call to Lookup().
	Error error
}

MockUserLookup implements policy.UserLookup for testing.

  • Set [User] for a default user returned on any Lookup call.
  • Set [Error] to force every Lookup call to fail.

func (*MockUserLookup) Lookup

func (m *MockUserLookup) Lookup(username string) (*user.User, error)

Lookup implements policy.UserLookup.

Jump to

Keyboard shortcuts

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