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

Function Test_NewCmdApi_WindowsAbsPath

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

Source from the content-addressed store, hash-verified

413}
414
415func Test_NewCmdApi_WindowsAbsPath(t *testing.T) {
416 if runtime.GOOS != "windows" {
417 t.SkipNow()
418 }
419
420 cmd := NewCmdApi(&cmdutil.Factory{}, func(opts *ApiOptions) error {
421 return nil
422 })
423
424 cmd.SetArgs([]string{`C:\users\repos`})
425 _, err := cmd.ExecuteC()
426 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`)
427}
428
429func TestNewCmdApiTelemetry(t *testing.T) {
430 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