Add optional interface DirCacheFlush for making the tests more reliable

This is defined for the users of dircache drive, onedrive, and acd.

This helps fix the DirMove tests on acd.
This commit is contained in:
Nick Craig-Wood
2016-12-09 16:57:07 +00:00
parent d911bf3889
commit 48a2e3844d
5 changed files with 45 additions and 14 deletions
+9 -2
View File
@@ -635,6 +635,12 @@ func (f *Fs) Purge() error {
return f.purgeCheck("", false)
}
// DirCacheFlush resets the directory cache - used in testing as an
// optional interface
func (f *Fs) DirCacheFlush() {
f.dirCache.ResetRoot()
}
// Hashes returns the supported hash sets.
func (f *Fs) Hashes() fs.HashSet {
return fs.HashSet(fs.HashSHA1)
@@ -960,6 +966,7 @@ var (
_ fs.Copier = (*Fs)(nil)
// _ fs.Mover = (*Fs)(nil)
// _ fs.DirMover = (*Fs)(nil)
_ fs.Object = (*Object)(nil)
_ fs.MimeTyper = &Object{}
_ fs.DirCacheFlusher = (*Fs)(nil)
_ fs.Object = (*Object)(nil)
_ fs.MimeTyper = &Object{}
)