def assertFileHeaderFromListWriteFile(self, input_directory, input_recipe, output_directory, output_recipe): recipe_header = load_recipe_header_list(input_directory, input_recipe, []) header_list = recipe_header.recipe_list xyz_filename = translate_filename(input_directory, input_recipe, output_directory) got_path_file = xyz_filename.output_path_file translate_list = translate_recipe_header_list(header_list) write_file(got_path_file, translate_list) file_object = open_file(output_directory,output_recipe) self.assertTrue(file_object.success, "Failed to open file " + output_recipe + " successfully")
def test_read_directory_and_write_empty_named_files(self): matching = self.getRecipeList() for a in range(len(matching)): filename = matching[a].replace('.htm', '.xyz') output_filename = os.path.join("C:\\Temp\\",filename) write_file(output_filename, [""]) directory_object_check = read_directory("C:\Temp") matching_check = [s for s in directory_object_check.filelist if ".xyz" in s] self.assertEqual(len(matching),len(matching_check))