Known subclasses: twisted.python.test.test_release.CommandsTestMixin

A mixin for TestCase subclasses which provides some methods for asserting the structure and contents of directories and files on the filesystem.

Method createStructure Create a set of directories and files given a dict defining their structure.
Method assertStructure Assert that a directory is equivalent to one described by a dict.
def createStructure(self, root, dirDict):
Create a set of directories and files given a dict defining their
        structure.

        @param root: The directory in which to create the structure.  It must
            already exist.
        @type root: L{FilePath}

        @param dirDict: The dict defining the structure. Keys should be strings
            naming files, values should be strings describing file contents OR
            dicts describing subdirectories.  All files are written in binary
            mode.  Any string values are assumed to describe text files and
            will have their newlines replaced with the platform-native newline
            convention.  For example::

                {"foofile": "foocontents",
                 "bardir": {"barfile": "bar
contents"}}
        @type dirDict: C{dict}
        
def assertStructure(self, root, dirDict):

Assert that a directory is equivalent to one described by a dict.

ParametersrootThe filesystem directory to compare. (type: FilePath)
dirDictThe dict that should describe the contents of the directory. It should be the same structure as the dirDict parameter to createStructure. (type: dict)
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.