(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestNew_ServerURL_dotcomFallback(t *testing.T) { |
| 296 | t.Setenv("GITHUB_SERVER_URL", "") |
| 297 | f := &cmdutil.Factory{ |
| 298 | Config: func() (gh.Config, error) { |
| 299 | return nil, errors.New("Failed to load") |
| 300 | }, |
| 301 | } |
| 302 | api := New(f) |
| 303 | |
| 304 | if api.githubServer != "https://github.com" { |
| 305 | t.Fatalf("expected https://github.com, got %s", api.githubServer) |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | func TestCreateCodespaces(t *testing.T) { |
| 310 | svr := createFakeCreateEndpointServer(t, http.StatusCreated) |