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

Function TestGetVCSUserSkipsBitbucketBotAuthor

action/command/vcs_user_test.go:152–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestGetVCSUserSkipsBitbucketBotAuthor(t *testing.T) {
153 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
154 w.Header().Set("Content-Type", "application/json")
155 _, err := w.Write([]byte(`{"author":{"account_id":"557058:bot-account","nickname":"release[bot]","type":"bot"}}`))
156 require.NoError(t, err)
157 }))
158 t.Cleanup(server.Close)
159
160 t.Setenv("BITBUCKET_PR_ID", "10")
161 t.Setenv("BITBUCKET_REPO_FULL_NAME", "bytebase/example")
162 t.Setenv("BYTEBASE_BITBUCKET_API_BASE_URL", server.URL)
163
164 require.Nil(t, getVCSUser(world.Bitbucket))
165}
166
167func TestGetVCSUserSkipsBitbucketAppUserAuthor(t *testing.T) {
168 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {

Callers

nothing calls this directly

Calls 2

getVCSUserFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected