fstests

package
v0.0.0-...-1b1593a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package fstests provides generic tests for testing the Fs and Object interfaces

Run go generate to write the tests for the remotes

Index

Constants

This section is empty.

Variables

View Source
var (

	// RemoteName should be set to the name of the remote for testing
	RemoteName = ""

	// NilObject should be set to a nil Object from the Fs under test
	NilObject fs.Object
	// ExtraConfig is for adding config to a remote
	ExtraConfig = []ExtraConfigItem{}
	// SkipBadWindowsCharacters skips unusable characters for windows if set
	SkipBadWindowsCharacters = map[string]bool{}
)

Functions

func TestFinalise

func TestFinalise(t *testing.T)

TestFinalise tidies up after the previous tests

func TestFsCopy

func TestFsCopy(t *testing.T)

TestFsCopy tests Copy

func TestFsDirChangeNotify

func TestFsDirChangeNotify(t *testing.T)

TestFsDirChangeNotify tests that changes to directories are properly propagated

go test -v -remote TestDrive: -run '^Test(Setup|Init|FsDirChangeNotify)$' -verbose

func TestFsDirMove

func TestFsDirMove(t *testing.T)

TestFsDirMove tests DirMove

go test -v -run '^Test(Setup|Init|FsMkdir|FsPutFile1|FsPutFile2|FsUpdateFile1|FsDirMove)$

func TestFsIsFile

func TestFsIsFile(t *testing.T)

TestFsIsFile tests that an error is returned along with a valid fs which points to the parent directory.

func TestFsIsFileNotFound

func TestFsIsFileNotFound(t *testing.T)

TestFsIsFileNotFound tests that an error is not returned if no object is found

func TestFsListDirEmpty

func TestFsListDirEmpty(t *testing.T)

TestFsListDirEmpty tests listing the directories from an empty directory

func TestFsListDirFile2

func TestFsListDirFile2(t *testing.T)

TestFsListDirFile2 tests the files are correctly uploaded by doing Depth 1 directory listings

func TestFsListDirRoot

func TestFsListDirRoot(t *testing.T)

TestFsListDirRoot tests that DirList works in the root

func TestFsListEmpty

func TestFsListEmpty(t *testing.T)

TestFsListEmpty tests listing an empty directory

func TestFsListFile1

func TestFsListFile1(t *testing.T)

TestFsListFile1 tests file present

func TestFsListFile1and2

func TestFsListFile1and2(t *testing.T)

TestFsListFile1and2 tests two files present

func TestFsListLevel2

func TestFsListLevel2(t *testing.T)

TestFsListLevel2 tests List works for 2 levels

func TestFsListRDirEmpty

func TestFsListRDirEmpty(t *testing.T)

TestFsListRDirEmpty tests listing the directories from an empty directory using ListR

func TestFsListRDirFile2

func TestFsListRDirFile2(t *testing.T)

TestFsListRDirFile2 tests the files are correctly uploaded by doing Depth 1 directory listings using ListR

func TestFsListRDirRoot

func TestFsListRDirRoot(t *testing.T)

TestFsListRDirRoot tests that DirList works in the root using ListR

func TestFsListRLevel2

func TestFsListRLevel2(t *testing.T)

TestFsListRLevel2 tests List works for 2 levels using ListR

func TestFsListRSubdir

func TestFsListRSubdir(t *testing.T)

TestFsListRSubdir tests List works for a subdirectory using ListR

func TestFsListSubdir

func TestFsListSubdir(t *testing.T)

TestFsListSubdir tests List works for a subdirectory

func TestFsMkdir

func TestFsMkdir(t *testing.T)

TestFsMkdir tests tests making a directory

func TestFsMkdirRmdirSubdir

func TestFsMkdirRmdirSubdir(t *testing.T)

TestFsMkdirRmdirSubdir tests making and removing a sub directory

func TestFsMove

func TestFsMove(t *testing.T)

TestFsMove tests Move

func TestFsName

func TestFsName(t *testing.T)

TestFsName tests the Name method

func TestFsNewObject

func TestFsNewObject(t *testing.T)

TestFsNewObject tests NewObject

func TestFsNewObjectDir

func TestFsNewObjectDir(t *testing.T)

TestFsNewObjectDir tests NewObject on a directory which should produce an error

func TestFsNewObjectNotFound

func TestFsNewObjectNotFound(t *testing.T)

TestFsNewObjectNotFound tests not finding a object

func TestFsPrecision

func TestFsPrecision(t *testing.T)

TestFsPrecision tests the Precision of the Fs

func TestFsPutError

func TestFsPutError(t *testing.T)

TestFsPutError tests uploading a file where there is an error

It makes sure that aborting a file half way through does not create a file on the remote.

func TestFsPutFile1

func TestFsPutFile1(t *testing.T)

TestFsPutFile1 tests putting a file

func TestFsPutFile2

func TestFsPutFile2(t *testing.T)

TestFsPutFile2 tests putting a file into a subdirectory

func TestFsPutStream

func TestFsPutStream(t *testing.T)

TestFsPutStream tests uploading files when size is not known in advance

func TestFsRmdirEmpty

func TestFsRmdirEmpty(t *testing.T)

TestFsRmdirEmpty tests deleting an empty directory

func TestFsRmdirFull

func TestFsRmdirFull(t *testing.T)

TestFsRmdirFull tests removing a non empty directory

func TestFsRmdirNotFound

func TestFsRmdirNotFound(t *testing.T)

TestFsRmdirNotFound tests deleting a non existent directory

func TestFsRoot

func TestFsRoot(t *testing.T)

TestFsRoot tests the Root method

func TestFsString

func TestFsString(t *testing.T)

TestFsString tests the String method

func TestFsUpdateFile1

func TestFsUpdateFile1(t *testing.T)

TestFsUpdateFile1 tests updating file1 with new contents

func TestInit

func TestInit(t *testing.T)

TestInit tests basic intitialisation

func TestObjectFs

func TestObjectFs(t *testing.T)

TestObjectFs tests the object can be found

func TestObjectHashes

func TestObjectHashes(t *testing.T)

TestObjectHashes checks all the hashes the object supports

func TestObjectMimeType

func TestObjectMimeType(t *testing.T)

TestObjectMimeType tests the MimeType of the object is correct

func TestObjectModTime

func TestObjectModTime(t *testing.T)

TestObjectModTime tests the ModTime of the object is correct

func TestObjectOpen

func TestObjectOpen(t *testing.T)

TestObjectOpen tests that Open works

func TestObjectOpenSeek

func TestObjectOpenSeek(t *testing.T)

TestObjectOpenSeek tests that Open works with Seek

func TestObjectPartialRead

func TestObjectPartialRead(t *testing.T)

TestObjectPartialRead tests that reading only part of the object does the correct thing

func TestObjectPurge

func TestObjectPurge(t *testing.T)

TestObjectPurge tests Purge

func TestObjectRemote

func TestObjectRemote(t *testing.T)

TestObjectRemote tests the Remote is correct

func TestObjectRemove

func TestObjectRemove(t *testing.T)

TestObjectRemove tests Remove

func TestObjectSetModTime

func TestObjectSetModTime(t *testing.T)

TestObjectSetModTime tests that SetModTime works

func TestObjectSize

func TestObjectSize(t *testing.T)

TestObjectSize tests that Size works

func TestObjectStorable

func TestObjectStorable(t *testing.T)

TestObjectStorable tests that Storable works

func TestObjectString

func TestObjectString(t *testing.T)

TestObjectString tests the Object String method

func TestObjectUpdate

func TestObjectUpdate(t *testing.T)

TestObjectUpdate tests that Update works

Types

type ExtraConfigItem

type ExtraConfigItem struct{ Name, Key, Value string }

ExtraConfigItem describes a config item added on the fly while testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL