MCPcopy
hub / github.com/dapr/dapr / TestGetNamespaceOrDefault

Function TestGetNamespaceOrDefault

utils/utils_test.go:252–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func TestGetNamespaceOrDefault(t *testing.T) {
253 t.Run("namespace is empty", func(t *testing.T) {
254 ns := GetNamespaceOrDefault("default")
255 assert.Equal(t, "default", ns)
256 })
257
258 t.Run("namespace is not empty", func(t *testing.T) {
259 t.Setenv("NAMESPACE", "testNs")
260 ns := GetNamespaceOrDefault("default")
261 assert.Equal(t, "testNs", ns)
262 })
263}
264
265func BenchmarkFilter(b *testing.B) {
266 vals := make([]int, 100)

Callers

nothing calls this directly

Calls 3

GetNamespaceOrDefaultFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected