operations: move interface assertion to tests to remove pflag dependency #3792

This commit is contained in:
Nick Craig-Wood 2019-12-10 13:28:56 +00:00
parent a4bc4daf30
commit 11f501bd44
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,6 @@ import (
"github.com/rclone/rclone/fs/config"
"github.com/rclone/rclone/fs/hash"
"github.com/rclone/rclone/fs/walk"
"github.com/spf13/pflag"
)
// dedupeRename renames the objs slice to different names
@ -196,9 +195,6 @@ func (x *DeduplicateMode) Type() string {
return "string"
}
// Check it satisfies the interface
var _ pflag.Value = (*DeduplicateMode)(nil)
// dedupeFindDuplicateDirs scans f for duplicate directories
func dedupeFindDuplicateDirs(ctx context.Context, f fs.Fs) ([][]fs.Directory, error) {
dirs := map[string][]fs.Directory{}

View File

@ -10,10 +10,14 @@ import (
"github.com/rclone/rclone/fs/operations"
"github.com/rclone/rclone/fs/walk"
"github.com/rclone/rclone/fstest"
"github.com/spf13/pflag"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// Check flag satisfies the interface
var _ pflag.Value = (*operations.DeduplicateMode)(nil)
func skipIfCantDedupe(t *testing.T, f fs.Fs) {
if !f.Features().DuplicateFiles {
t.Skip("Can't test deduplicate - no duplicate files possible")