def test_write_file_exist(self): fileutil.write_to_file(self.already_file, self.content) assert os.path.exists(self.already_file) assert os.path.exists("%s.1" % self.already_file) self._compare_content(self.already_file)
def test_write_file_exist_dir(self): fileutil.write_to_file(self.already_dir, self.content) realfile = os.path.join(self.already_dir, fileutil.DEFAULT_FILE_NAME) assert os.path.exists(realfile) self._compare_content(realfile)
def test_write_file(self): filename = "filename" fileutil.write_to_file(filename, self.content) assert os.path.exists(filename) self._compare_content(filename)
def write_file_handler(app): snippet = buffers.get_content(app) filename = app.snippet_file fileutil.write_to_file(filename, snippet)