MCPcopy Create free account
hub / github.com/bytebase/bytebase / requireWebhookCount

Function requireWebhookCount

backend/tests/webhook_helpers_test.go:94–98  ·  view source on GitHub ↗

requireWebhookCount asserts the exact count of webhooks for (project, eventTitle).

(t *testing.T, c *webhookCollector, projectName, eventTitle string, n int)

Source from the content-addressed store, hash-verified

92
93// requireWebhookCount asserts the exact count of webhooks for (project, eventTitle).
94func requireWebhookCount(t *testing.T, c *webhookCollector, projectName, eventTitle string, n int) {
95 t.Helper()
96 got := countWebhooksFor(c, projectName, eventTitle)
97 require.Equalf(t, n, got, "expected %d %q webhooks on %s, got %d", n, eventTitle, projectName, got)
98}
99
100func countWebhooksFor(c *webhookCollector, projectName, eventTitle string) int {
101 n := 0

Callers 1

TestWebhookIntegrationFunction · 0.85

Calls 1

countWebhooksForFunction · 0.85

Tested by

no test coverage detected