fix(10-02): stabilize GitHubSource provider-name test
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
@@ -144,8 +143,8 @@ func TestGitHubSource_ProviderNameFromKeyword(t *testing.T) {
|
||||
|
||||
// Track which query came in so we can assert providerName mapping per-call.
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query().Get("q")
|
||||
body := fmt.Sprintf(`{"items":[{"html_url":"https://example/%s","repository":{"full_name":"o/r"}}]}`, q)
|
||||
// Query contains spaces/quotes — don't interpolate it into JSON.
|
||||
body := `{"items":[{"html_url":"https://example/x","repository":{"full_name":"o/r"}}]}`
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(body))
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user