MCPcopy Create free account
hub / github.com/github/gh-aw / TestDomainStatus

Function TestDomainStatus

pkg/cli/audit_diff_test.go:266–284  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

264}
265
266func TestDomainStatus(t *testing.T) {
267 tests := []struct {
268 name string
269 stats DomainRequestStats
270 expected string
271 }{
272 {name: "allowed only", stats: DomainRequestStats{Allowed: 5, Blocked: 0}, expected: "allowed"},
273 {name: "denied only", stats: DomainRequestStats{Allowed: 0, Blocked: 3}, expected: "denied"},
274 {name: "mixed", stats: DomainRequestStats{Allowed: 2, Blocked: 1}, expected: "mixed"},
275 {name: "zero requests", stats: DomainRequestStats{Allowed: 0, Blocked: 0}, expected: "unknown"},
276 }
277
278 for _, tt := range tests {
279 t.Run(tt.name, func(t *testing.T) {
280 result := classifyFirewallDomainStatus(tt.stats)
281 assert.Equal(t, tt.expected, result, "Domain status should match")
282 })
283 }
284}
285
286func TestFormatVolumeChange(t *testing.T) {
287 tests := []struct {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected