add unittest for SetNamespace method

Signed-off-by: yxxhero <aiopsclub@163.com>
pull/10230/head
yxxhero 3 years ago
parent d376a67ba8
commit 0d3289eb0b

@ -25,6 +25,20 @@ import (
"github.com/spf13/pflag"
)
func TestSetNamespace(t *testing.T) {
settings := New()
if settings.namespace != "" {
t.Errorf("Expected empty namespace, got %s", settings.namespace)
}
settings.SetNamespace("testns")
if settings.namespace != "testns" {
t.Errorf("Expected namespace testns, got %s", settings.namespace)
}
}
func TestEnvSettings(t *testing.T) {
tests := []struct {
name string

Loading…
Cancel
Save