class documentation

class IFTPShellTestsMixin: (source)

Known subclasses: twisted.test.test_ftp.FTPShellTests

View In Hierarchy

Generic tests for the IFTPShell interface.

Method createDirectory Create a directory in path.
Method createFile Create a file named path with some content.
Method directoryExists Test if the directory exists at path.
Method fileExists Test if the file exists at path.
Method test_access Try to access a resource.
Method test_accessNotFound access should fail on a resource that doesn't exist.
Method test_createDirectory directoryExists should report correctly about directory existence, and createDirectory should create a directory detectable by directoryExists.
Method test_createFile fileExists should report correctly about file existence, and createFile should create a file detectable by fileExists.
Method test_invalidStat Querying an invalid stat should result to a AttributeError.
Method test_list Check the output of the list method.
Method test_listFile Check the output of the list method on a file.
Method test_listNotExistingDirectory list on a directory that doesn't exist should fail with a ftp.FileNotFoundError.
Method test_listWithInvalidStat Querying an invalid stat should result to a AttributeError.
Method test_listWithStat Check the output of list with asked stats.
Method test_makeDirectory Create a directory and check it ends in the filesystem.
Method test_makeDirectoryError Creating a directory that already exists should fail with a ftp.FileExistsError.
Method test_openForReading Check that openForReading returns an object providing ftp.IReadFile.
Method test_openForReadingNotFound openForReading should fail with a ftp.FileNotFoundError on a file that doesn't exist.
Method test_openForReadingOnDirectory openForReading should not work on directory.
Method test_openForWriting Check that openForWriting returns an object providing ftp.IWriteFile.
Method test_openForWritingExistingDirectory openForWriting should not be able to open a directory that already exists.
Method test_openForWritingInNotExistingDirectory openForWring should fail with a ftp.FileNotFoundError if you specify a file in a directory that doesn't exist.
Method test_removeDirectory Try to remove a directory and check it's removed from the filesystem.
Method test_removeDirectoryOnFile removeDirectory should not work in file and fail with a ftp.IsNotADirectoryError.
Method test_removeFile Try to remove a file and check it's removed from the filesystem.
Method test_removeFileOnDirectory removeFile should not work on directory.
Method test_removeNotExistingDirectory Removing directory that doesn't exist should fail with a ftp.FileNotFoundError.
Method test_removeNotExistingFile Try to remove a non existent file, and check it raises a ftp.FileNotFoundError.
Method test_rename Try to rename a directory.
Method test_renameNotExisting Renaming a directory that doesn't exist should fail with ftp.FileNotFoundError.
Method test_statDirectory Check the output of the stat method on a directory.
Method test_statFile Check the output of the stat method on a file.
Method test_statHardlinksNotImplemented If twisted.python.filepath.FilePath.getNumberOfHardLinks is not implemented, the number returned is 0
Method test_statNotExisting stat should fail with ftp.FileNotFoundError on a file that doesn't exist.
Method test_statOwnerGroup Check the owner and groups stats.
Method test_statOwnerGroupNotImplemented If twisted.python.filepath.FilePath.getUserID or twisted.python.filepath.FilePath.getGroupID are not implemented, the owner returned is "0" and the group is returned as "0"
def createDirectory(self, path): (source)

Create a directory in path.

Parameters
path:strthe relative path of the directory to create, with one segment.
def createFile(self, path, fileContent=b''): (source)

Create a file named path with some content.

Parameters
path:strthe relative path of the file to create, without directory.
fileContent:strthe content of the file.
def directoryExists(self, path): (source)

Test if the directory exists at path.

Parameters
path:str.the relative path to check.
Returns
boolTrue if path exists and is a directory, False if it's not the case
def fileExists(self, path): (source)

Test if the file exists at path.

Parameters
path:str.the relative path to check.
Returns
boolTrue if path exists and is a file, False if it's not the case.
def test_access(self): (source)

Try to access a resource.

def test_accessNotFound(self): (source)

access should fail on a resource that doesn't exist.

def test_createDirectory(self): (source)

directoryExists should report correctly about directory existence, and createDirectory should create a directory detectable by directoryExists.

def test_createFile(self): (source)

fileExists should report correctly about file existence, and createFile should create a file detectable by fileExists.

def test_invalidStat(self): (source)

Querying an invalid stat should result to a AttributeError.

def test_list(self): (source)

Check the output of the list method.

def test_listFile(self): (source)

Check the output of the list method on a file.

def test_listNotExistingDirectory(self): (source)

list on a directory that doesn't exist should fail with a ftp.FileNotFoundError.

def test_listWithInvalidStat(self): (source)

Querying an invalid stat should result to a AttributeError.

def test_listWithStat(self): (source)

Check the output of list with asked stats.

def test_makeDirectory(self): (source)

Create a directory and check it ends in the filesystem.

def test_makeDirectoryError(self): (source)

Creating a directory that already exists should fail with a ftp.FileExistsError.

def test_openForReading(self): (source)

Check that openForReading returns an object providing ftp.IReadFile.

def test_openForReadingNotFound(self): (source)

openForReading should fail with a ftp.FileNotFoundError on a file that doesn't exist.

def test_openForReadingOnDirectory(self): (source)

openForReading should not work on directory.

def test_openForWriting(self): (source)

Check that openForWriting returns an object providing ftp.IWriteFile.

def test_openForWritingExistingDirectory(self): (source)

openForWriting should not be able to open a directory that already exists.

def test_openForWritingInNotExistingDirectory(self): (source)

openForWring should fail with a ftp.FileNotFoundError if you specify a file in a directory that doesn't exist.

def test_removeDirectory(self): (source)

Try to remove a directory and check it's removed from the filesystem.

def test_removeDirectoryOnFile(self): (source)

removeDirectory should not work in file and fail with a ftp.IsNotADirectoryError.

def test_removeFile(self): (source)

Try to remove a file and check it's removed from the filesystem.

def test_removeFileOnDirectory(self): (source)

removeFile should not work on directory.

def test_removeNotExistingDirectory(self): (source)

Removing directory that doesn't exist should fail with a ftp.FileNotFoundError.

def test_removeNotExistingFile(self): (source)

Try to remove a non existent file, and check it raises a ftp.FileNotFoundError.

def test_rename(self): (source)

Try to rename a directory.

def test_renameNotExisting(self): (source)

Renaming a directory that doesn't exist should fail with ftp.FileNotFoundError.

def test_statDirectory(self): (source)

Check the output of the stat method on a directory.

def test_statFile(self): (source)

Check the output of the stat method on a file.

def test_statHardlinksNotImplemented(self): (source)

If twisted.python.filepath.FilePath.getNumberOfHardLinks is not implemented, the number returned is 0

def test_statNotExisting(self): (source)

stat should fail with ftp.FileNotFoundError on a file that doesn't exist.

def test_statOwnerGroup(self): (source)

Check the owner and groups stats.

def test_statOwnerGroupNotImplemented(self): (source)

If twisted.python.filepath.FilePath.getUserID or twisted.python.filepath.FilePath.getGroupID are not implemented, the owner returned is "0" and the group is returned as "0"