twisted.python.test.test_release.StructureAssertingMixin(object)
class documentationtwisted.python.test.test_release
(View In Hierarchy)
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. |
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}
Assert that a directory is equivalent to one described by a dict.
Parameters | root | The filesystem directory to compare. (type: FilePath ) |
dirDict | The dict that should describe the contents of the directory. It should be
the same structure as the dirDict parameter to createStructure . (type: dict ) |