MCPcopy
hub / github.com/rclone/rclone / TestPatternAlbumsToEntries

Function TestPatternAlbumsToEntries

backend/googlephotos/pattern_test.go:502–537  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

500}
501
502func TestPatternAlbumsToEntries(t *testing.T) {
503 f := newTestLister(t)
504 ctx := context.Background()
505
506 _, err := albumsToEntries(ctx, f, false, "potato/", "sub")
507 assert.Equal(t, fs.ErrorDirNotFound, err)
508
509 f.albums.add(&api.Album{
510 ID: "1",
511 Title: "sub/one",
512 })
513
514 entries, err := albumsToEntries(ctx, f, false, "potato/", "sub")
515 assert.NoError(t, err)
516 assert.Equal(t, 1, len(entries))
517 assert.Equal(t, "potato/one", entries[0].Remote())
518 _, ok := entries[0].(fs.Directory)
519 assert.Equal(t, true, ok)
520
521 f.albums.add(&api.Album{
522 ID: "1",
523 Title: "sub",
524 })
525 f.names = []string{"file.jpg"}
526
527 entries, err = albumsToEntries(ctx, f, false, "potato/", "sub")
528 assert.NoError(t, err)
529 assert.Equal(t, 2, len(entries))
530 assert.Equal(t, "potato/one", entries[0].Remote())
531 _, ok = entries[0].(fs.Directory)
532 assert.Equal(t, true, ok)
533 assert.Equal(t, "potato/file.jpg", entries[1].Remote())
534 _, ok = entries[1].(fs.Object)
535 assert.Equal(t, true, ok)
536
537}

Callers

nothing calls this directly

Calls 5

newTestListerFunction · 0.85
albumsToEntriesFunction · 0.85
RemoteMethod · 0.65
EqualMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…