'Removes the directory pointed to by the given ``path``.
If the second argument ``recursive`` is given a true value (see
`Boolean arguments`), the directory is removed recursively. Otherwise
removing fails if the directory is not empty.
If the directory pointed to by the ``path`` does not exist, the keyword
passes, but it fails, if the ``path`` points to a file.'

def remove_directory(self, path, recursive=False):

    path = self._absnorm(path)
    if (not os.path.exists(path)):
        self._link("Directory    '%s'    does    not    exist.", path)
    elif (not os.path.isdir(path)):
        self._error(("Path    '%s'    is    not    a    directory." % path))
    else:
        if is_truthy(recursive):
            shutil.rmtree(path)
        else:
            self.directory_should_be_empty(path, ("Directory    '%s'    is    not    empty." % path))
            os.rmdir(path)
        self._link("Removed    directory    '%s'.", path)
