Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

clitest

package
v0.27.3Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:29Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateGoldenFiles =flag.Bool("update",false, "update .golden files")

UpdateGoldenFiles indicates golden files should be updated.To update the golden files:make update-golden-files

Functions

funcCreateTemplateVersionSourceadded inv0.4.0

func CreateTemplateVersionSource(t *testing.T, responses *echo.Responses)string

CreateTemplateVersionSource writes the echo provisioner responses into anew temporary testing directory.

funcHandlersOKadded inv0.25.0

func HandlersOK(t *testing.T, cmd *clibase.Cmd)

HandlersOK asserts that all commands have a handler.Without a handler, the command has no default behavior. Even fornon-root commands (like 'groups' or 'users'), a handler is required.These handlers are likely just the 'help' handler, but this must beexplicitly set.

funcNew

func New(t *testing.T, args ...string) (*clibase.Invocation,config.Root)

New creates a CLI instance with a configuration pointed to atemporary testing directory.

funcNewWithCommandadded inv0.21.0

func NewWithCommand(t *testing.T, cmd *clibase.Cmd, args ...string,) (*clibase.Invocation,config.Root)

funcNormalizeGoldenFileadded inv0.24.1

func NormalizeGoldenFile(t *testing.T, byt []byte) []byte

NormalizeGoldenFile replaces any strings that are system or timing dependentwith a placeholder so that the golden files can be compared with a simpleequality check.

funcRunadded inv0.21.0

func Run(t *testing.T, inv *clibase.Invocation)

Run runs the command and asserts that there is no error.

funcSetupConfig

func SetupConfig(t *testing.T, client *codersdk.Client, rootconfig.Root)

SetupConfig applies the URL and SessionToken of the client to the config.

funcStartadded inv0.19.0

func Start(t *testing.T, inv *clibase.Invocation)

Start runs the command in a goroutine and cleans it up when the testcompleted.

funcTestCommandHelpadded inv0.24.1

func TestCommandHelp(t *testing.T, getRoot func(t *testing.T) *clibase.Cmd, cases []CommandHelpCase)

TestCommandHelp will test the help output of the given commandsusing golden files.

Types

typeCommandHelpCaseadded inv0.24.1

type CommandHelpCase struct {NamestringCmd  []string}

funcDefaultCasesadded inv0.24.1

func DefaultCases() []CommandHelpCase

typeErrorWaiteradded inv0.21.0

type ErrorWaiter struct {// contains filtered or unexported fields}

funcStartWithWaiteradded inv0.21.0

func StartWithWaiter(t *testing.T, inv *clibase.Invocation) *ErrorWaiter

StartWithWaiter runs the command in a goroutine but returns the error insteadof asserting it. This is useful for testing error cases.

func (*ErrorWaiter)Canceladded inv0.23.5

func (w *ErrorWaiter) Cancel()

func (*ErrorWaiter)RequireAsadded inv0.21.0

func (w *ErrorWaiter) RequireAs(want interface{})

func (*ErrorWaiter)RequireContainsadded inv0.21.0

func (w *ErrorWaiter) RequireContains(sstring)

func (*ErrorWaiter)RequireErroradded inv0.21.0

func (w *ErrorWaiter) RequireError()

func (*ErrorWaiter)RequireIsadded inv0.21.0

func (w *ErrorWaiter) RequireIs(wanterror)

func (*ErrorWaiter)RequireSuccessadded inv0.21.0

func (w *ErrorWaiter) RequireSuccess()

func (*ErrorWaiter)Waitadded inv0.21.0

func (w *ErrorWaiter) Wait()error

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp