'Creates the specified directory.
Also possible intermediate directories are created. Passes if the
directory already exists, but fails if the path exists and is not
a directory.'

def create_directory(self, path):

    path = self._absnorm(path)
    if os.path.isdir(path):
        self._link("Directory    '%s'    already    exists.", path)
    elif os.path.exists(path):
        self._error(("Path    '%s'    is    not    a    directory." % path))
    else:
        os.makedirs(path)
        self._link("Created    directory    '%s'.", path)
