These functions make it easy to check the state of files and directories. When the assertion is not true, they provide informative error messages.
Assert that something exists at the given path.
Assert that nothing exists at the given path.
Assert that path exists and is a regular file.
With follow_symlinks=True, the default, this will pass if path is a symlink to a regular file. With follow_symlinks=False, it will fail in that case.
Assert that path exists but is not a regular file.
With follow_symlinks=True, the default, this will fail if path is a symlink to a regular file. With follow_symlinks=False, it will pass in that case.
Assert that path exists and is a directory.
With follow_symlinks=True, the default, this will pass if path is a symlink to a directory. With follow_symlinks=False, it will fail in that case.
Assert that path exists but is not a directory.
With follow_symlinks=True, the default, this will fail if path is a symlink to a directory. With follow_symlinks=False, it will pass in that case.
Assert that path exists and is a symlink.
If to is specified, also check that it is the target of the symlink.
Assert that path exists but is not a symlink.