MCPcopy Create free account
hub / github.com/52funny/pikpakcli / TestExpandShellGlobsDelete

Function TestExpandShellGlobsDelete

internal/shell/shell_test.go:498–519  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

496}
497
498func TestExpandShellGlobsDelete(t *testing.T) {
499 rootCmd := &cobra.Command{Use: "pikpakcli"}
500 deleteCmd := &cobra.Command{Use: "delete"}
501 deleteCmd.Flags().StringP("path", "p", "/", "")
502 rootCmd.AddCommand(deleteCmd)
503
504 args := adaptShellArgs(rootCmd, "/Movies", []string{"delete", "*.srt"})
505 expanded, err := expandShellGlobs(rootCmd, "/Movies", fakeFileStatProvider{
506 folders: map[string][]api.FileStat{
507 "movies-id": {
508 {Name: "episode-1.srt", Kind: api.FileKindFile},
509 {Name: "episode-2.srt", Kind: api.FileKindFile},
510 {Name: "episode-1.mkv", Kind: api.FileKindFile},
511 },
512 },
513 ids: map[string]string{
514 "/Movies": "movies-id",
515 },
516 }, args)
517 require.NoError(t, err)
518 require.Equal(t, []string{"delete", "/Movies/episode-1.srt", "/Movies/episode-2.srt"}, expanded)
519}
520
521func TestExpandShellGlobsUpload(t *testing.T) {
522 rootCmd := &cobra.Command{Use: "pikpakcli"}

Callers

nothing calls this directly

Calls 2

adaptShellArgsFunction · 0.85
expandShellGlobsFunction · 0.85

Tested by

no test coverage detected