'Append contents to a file
``filename`` should be a relative path, e.g. "foo/bar/baz.txt"
It will be translated into a full path in a tmp dir.
Returns the full path to the file.'

def append_file(self, filename, contents):

    full_path = os.path.join(self.rootdir, filename)
    if (not os.path.isdir(os.path.dirname(full_path))):
        os.makedirs(os.path.dirname(full_path))
    with open(full_path, 'a') as f:
        f.write(contents)
    return full_path
