(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func 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 | |
| 167 | func TestGetVCSUserSkipsBitbucketAppUserAuthor(t *testing.T) { |
| 168 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
nothing calls this directly
no test coverage detected