MCPcopy Create free account
hub / github.com/cli/cli / Test_NewCmdApi_WindowsAbsPath

Function Test_NewCmdApi_WindowsAbsPath

pkg/cmd/api/api_test.go:414–426  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

412}
413
414func Test_NewCmdApi_WindowsAbsPath(t *testing.T) {
415 if runtime.GOOS != "windows" {
416 t.SkipNow()
417 }
418
419 cmd := NewCmdApi(&cmdutil.Factory{}, func(opts *ApiOptions) error {
420 return nil
421 })
422
423 cmd.SetArgs([]string{`C:\users\repos`})
424 _, err := cmd.ExecuteC()
425 assert.EqualError(t, err, `invalid API endpoint: "C:\users\repos". Your shell might be rewriting URL paths as filesystem paths. To avoid this, omit the leading slash from the endpoint argument`)
426}
427
428func TestNewCmdApiTelemetry(t *testing.T) {
429 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 1

NewCmdApiFunction · 0.85

Tested by

no test coverage detected