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_translate_xml_filename(self): xyz_filename = translate_filename( "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish", "_Victoria's_Pumpkin_Bread_(From__The_Dairy_Hollow_House_Cookbook__by_Crescent_Dragonwagon_with_Jan_Brown,_Macmillan_Publishing_Company).xml", "C:\\Temp\\") got_filename = xyz_filename.recipe_filename self.assertEqual(got_filename, "_Victoria's_Pumpkin_Bread_(From__The_Dairy_Hollow_House_Cookbook__by_Crescent_Dragonwagon_with_Jan_Brown,_Macmillan_Publishing_Company).xyz", "Mistranslated file extension") got_path_file = xyz_filename.output_path_file self.assertEqual(got_path_file, "C:\\Temp\\_Victoria's_Pumpkin_Bread_(From__The_Dairy_Hollow_House_Cookbook__by_Crescent_Dragonwagon_with_Jan_Brown,_Macmillan_Publishing_Company).xyz", "Wrong path and file name")
def test_translate_filename(self): xyz_filename = translate_filename( "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish", "Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.htm", "C:\\Temp\\") got_filename = xyz_filename.recipe_filename self.assertEqual(got_filename, "Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.xyz", "Mistranslated file extension") got_path_file = xyz_filename.output_path_file self.assertEqual(got_path_file, "C:\\Temp\\Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.xyz", "Wrong path and file name")