tl.testing.fs¶
Sandboxes of directories and files.
Functions¶
-
tl.testing.fs.
ls
()[source]¶ Print text lines listing the current working directory recursively.
The format of the text lines is the same as read by the
new_sandbox()
function. Lines are printed in alphabetical order.
-
tl.testing.fs.
new_sandbox
(specification)[source]¶ Create a directory with items given as lines of text, and chdir to it.
The specification is a multi-line string each of whose lines takes one of the following forms:
d foo
- create a directory named foo
f foo/bar asdf
- create a file named bar inside foo/ with content ‘asdf’
l baz -> foo/bar
- create a symbolic link named baz, pointing to foo/bar
The sandbox directory will be added to the known sandboxes so it can be removed when the test setup is torn down.