cmdtest

package
v1.1.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmdtest holds the fixtures the command package tests share. It is ordinary (non-test) code so that every command package can import it; it is used only from tests.

Index

Constants

View Source
const Profile = "default"

Profile is the profile name written by SaveConfig. Commands under test resolve it as the current profile, so they need no --profile flag.

Variables

This section is empty.

Functions

func ClearCredentialEnv

func ClearCredentialEnv(t *testing.T)

ClearCredentialEnv unsets the variables that would otherwise override the stored profile.

func SaveConfig

func SaveConfig(t *testing.T, apiURL, apiKey string)

SaveConfig points the CLI at a test server by storing a single profile. It also clears the credential environment variables, so a developer's shell cannot bleed into a test run.

func SectionBody

func SectionBody(t *testing.T, output, heading string) string

Returns the indented body of one rendered options section.

Types

This section is empty.

Jump to

Keyboard shortcuts

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