MCPcopy
hub / github.com/derailed/k9s / TestIsValidNamespace

Function TestIsValidNamespace

internal/client/client_test.go:85–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestIsValidNamespace(t *testing.T) {
86 c := NewTestAPIClient()
87
88 uu := map[string]struct {
89 ns string
90 cache NamespaceNames
91 ok bool
92 }{
93 "all-ns": {
94 ns: NamespaceAll,
95 cache: NamespaceNames{
96 DefaultNamespace: {},
97 },
98 ok: true,
99 },
100 "blank-ns": {
101 ns: BlankNamespace,
102 cache: NamespaceNames{
103 DefaultNamespace: {},
104 },
105 ok: true,
106 },
107 "cluster-ns": {
108 ns: ClusterScope,
109 cache: NamespaceNames{
110 DefaultNamespace: {},
111 },
112 ok: true,
113 },
114 "no-ns": {
115 ns: NotNamespaced,
116 cache: NamespaceNames{
117 DefaultNamespace: {},
118 },
119 ok: true,
120 },
121 "default-ns": {
122 ns: DefaultNamespace,
123 cache: NamespaceNames{
124 DefaultNamespace: {},
125 },
126 ok: true,
127 },
128 "valid-ns": {
129 ns: "fred",
130 cache: NamespaceNames{
131 "fred": {},
132 },
133 ok: true,
134 },
135 "invalid-ns": {
136 ns: "fred",
137 cache: NamespaceNames{
138 DefaultNamespace: {},
139 },
140 },
141 }
142

Callers

nothing calls this directly

Calls 4

NewTestAPIClientFunction · 0.85
AddMethod · 0.65
RunMethod · 0.65
IsValidNamespaceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…