mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-07 08:26:53 +00:00
18 lines
333 B
Go
18 lines
333 B
Go
package env
|
|
|
|
import "testing"
|
|
|
|
var t = &testing.T{}
|
|
|
|
// Patch an environment variable and defer to return to the previous state
|
|
func ExamplePatch() {
|
|
defer Patch(t, "PATH", "/custom/path")()
|
|
}
|
|
|
|
// Patch all environment variables
|
|
func ExamplePatchAll() {
|
|
defer PatchAll(t, map[string]string{
|
|
"ONE": "FOO",
|
|
"TWO": "BAR",
|
|
})()
|
|
}
|