MCPcopy Index your code
hub / github.com/google/go-github / TestClient_BaseURL

Function TestClient_BaseURL

github/github_test.go:1161–1195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1159}
1160
1161func TestClient_BaseURL(t *testing.T) {
1162 t.Parallel()
1163
1164 customBaseURL := "https://custom-url/api/v3/"
1165
1166 for _, tt := range []struct {
1167 name string
1168 client *Client
1169 wantBaseURL string
1170 }{
1171 {
1172 name: "default_base_url",
1173 client: mustNewClient(t),
1174 wantBaseURL: defaultBaseURL,
1175 },
1176 {
1177 name: "custom_base_url",
1178 client: &Client{baseURL: mustParseURL(t, customBaseURL)},
1179 wantBaseURL: customBaseURL,
1180 },
1181 {
1182 name: "missing_base_url",
1183 client: &Client{},
1184 wantBaseURL: "",
1185 },
1186 } {
1187 t.Run(tt.name, func(t *testing.T) {
1188 t.Parallel()
1189
1190 if got, want := tt.client.BaseURL(), tt.wantBaseURL; got != want {
1191 t.Errorf("Client.BaseURL() = %v, want %v", got, want)
1192 }
1193 })
1194 }
1195}
1196
1197func TestClient_UploadURL(t *testing.T) {
1198 t.Parallel()

Callers

nothing calls this directly

Calls 4

mustNewClientFunction · 0.85
mustParseURLFunction · 0.85
BaseURLMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…