MCPcopy
hub / github.com/cli/cli / Test_NewCmdApi_WindowsAbsPath

Function Test_NewCmdApi_WindowsAbsPath

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

NewCmdApiFunction · 0.85

Tested by

no test coverage detected