def test_load_named_recipe_header_into_list(self):
    recipe_header = load_recipe_header_list(
      "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish",
      "Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.htm", [])
    self.assertEqual.im_class.maxDiff = None
    self.assertEqual(recipe_header.recipe_list, 
      [["Gordon Hamersley's Boned Stuffed Leg of Lamb", "", "8 Servings", "",
      """New York Times Magazine - FOOD; NEW ENGLAND FANCY
BY NANCY HARMON JENKINS: Nancy Harmon Jenkins, a frequent contributor to the Food column, lives in the Boston area.
Published: April 2, 1989
[ Wait time: Minimum = 0 hours]""",
      """1.Preheat the oven to 375 degrees. Place the lamb bones in a roasting pan and roast for about 45 minutes. Roughly chop the unpeeled onion, the carrots and the celery and add to the roasting pan with the tomato paste. Mix to distribute the vegetables and coat them with tomato paste and fat from the lamb. Return to the oven and roast an additional 15 minutes.

2.Remove bones and vegetables from the pan and place them in a stock pot that is just large enough to hold them comfortably. Deglaze the roasting pan with the red wine over high heat and add to the stock pot. Then add enough chicken stock or water to just cover the bones in the pan.

Bring to a boil, skim any scum that rises and add a pinch of salt, two cloves of garlic, the bay leaf and peppercorns. Lower the heat to simmering, partially cover the stock pot and simmer for at least two hours. At the end of this time, the stock should have a destinctive lamb flavor.

3.Remove stock from the heat and strain through a coarse sieve. Return strained stock to the pan and cook briskly to reduce and thicken the stock. You should have about four cups of sauce when it is reduced.

4.While the sauce is cooking, clean and rinse the kale, stripping the leaves from the ribs. Discard the ribs. In a saute pan over medium high heat saute the kale in three tablespoons of olive oil until it is softened but still a little crisp to the bite. (You may need to add a bit of water to keep the kale from burning.) Remove from the heat and set aside.

5.Roast the red peppers over a gas flame, an electric grill or in a preheated broiler, turning until the outsides are blackened. Place in a paper bag for about 15 minutes to soften the skins. Then peel the peppers, discard the seeds and inner membranes and cut in thick slices.

6.Roughly chop the olives together with the peeled shallot and remaining garlic cloves. Mix in dried herbs.

7.Spread the butterflied lamb out on a countertop, skin side down. If the butcher has left the nugget of fat on the inside of the leg, remove and discard it. Layer the kale over the lamb, then layer the strips of red pepper over that. Sprinkle the olives, garlic and shallot pieces over the pepper strips, then sprinkle salt and cracked black pepper and about half the one-quarter cup of olive oil over the vegetables.

8.Roll the lamb leg, securing the stuffing, and tie it in several places with butcher's twine, tucking in the loose flaps at both ends. The result will be a long cylinder.

9.Preheat the oven to 400 degrees. Place the lamb roll on a rack in a roasting pan and roast for exactly one hour. Remove from the oven and set aside to rest for 15 minutes. Carve in thick (onehalf to three-quarter-inch) slices and serve on heated plates with a little of the hot sauce. Pass the rest of the sauce in a sauce boat.

Yield:Eight servings.""",
      ]])
  def test_load_second_named_recipe_header_into_list(self):
    recipe_header = load_recipe_header_list(
      "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish",
      "Ham_Biscuits_-_Gourmet_February_1995_Jessica_B__Harris_3.htm", [])
    self.assertEqual(recipe_header.recipe_list,
      [["Ham Biscuits - Gourmet February 1995 Jessica B. Harris", "Biscuits", "20 Servings", 
      """This is a surefire Southern way to use leftover ham and either leftover or freshly baked biscuits.
Sometimes the biscuits are large and the ham pieces merely roughly cut chunks. In this recipe the biscuits are made the size of silver dollars, the ham is thinly sliced and neatly trimmed, and the
biscuits are served with tiny dollops of spicy mustard and freshly grated horseradish. Voil\xe0! The "grab \'em and go" breakfast treat that has been imitated by many popular food chains is
transmuted into an elegant hors d\'oeuvre. Large or small, they\'re mighty good eating.
Can be prepared in 45 minutes or less.""", "",
      """Silver dollar - size biscuits are the quintessential African-American breakfast bread. They can be prepared in 45 minutes or less.

Split biscuits in half and spread lightly with mustard and horseradish. Put ham between biscuit halves.

Preheat oven to 400\xb0F.

In a bowl whisk together flour, baking powder, salt and sugar and with a fork or pastry blender blend in lard until mixture resembles course meal. Add milk, a little at a time, stirring until dough
just pulls away from side of bowl.

Roll out dough 1/2 inch thick on a lightly floured surface. Cut out biscuits with a 1 1/2-inch round cutter and transfer to an ungreased baking sheet. Reroll scraps and cut out more biscuits in same
manner.

Bake biscuits in middle of oven until pale golden, 10 to 15 minutes. Makes 20 silver dollar-size biscuits.

Makes about 20 ham biscuits.""",
      ]])
 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_load_variations(self):
    recipe_header = load_recipe_header_list(
      "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish",
      "Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.htm", [])
    self.assertEqual.im_class.maxDiff = None
    self.assertEqual(recipe_header.recipe_list[0][4], 
      """New York Times Magazine - FOOD; NEW ENGLAND FANCY
BY NANCY HARMON JENKINS: Nancy Harmon Jenkins, a frequent contributor to the Food column, lives in the Boston area.
Published: April 2, 1989
[ Wait time: Minimum = 0 hours]""")
  def test_load_second_subhead(self):
    recipe_header = load_recipe_header_list(
      "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish",
      "Ham_Biscuits_-_Gourmet_February_1995_Jessica_B__Harris_3.htm", [])
    self.assertEqual.im_class.maxDiff = None
    self.assertEqual(recipe_header.recipe_list[0][3], 
      """This is a surefire Southern way to use leftover ham and either leftover or freshly baked biscuits.
Sometimes the biscuits are large and the ham pieces merely roughly cut chunks. In this recipe the biscuits are made the size of silver dollars, the ham is thinly sliced and neatly trimmed, and the
biscuits are served with tiny dollops of spicy mustard and freshly grated horseradish. Voil\xe0! The "grab 'em and go" breakfast treat that has been imitated by many popular food chains is
transmuted into an elegant hors d'oeuvre. Large or small, they're mighty good eating.
Can be prepared in 45 minutes or less.""")
 def test_load_subhead(self):
   recipe_header = load_recipe_header_list(
     "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish",
     "Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.htm", [])
   self.assertEqual.im_class.maxDiff = None
   self.assertEqual(recipe_header.recipe_list[0][3], "")
 def translate_file_header_line_from_list(self, input_directory, input_recipe, header_list, header_index):
   recipe_header_original = load_recipe_header_list(input_directory, input_recipe, [])
   header_list = recipe_header_original.recipe_list
   translated_header_line_list = translate_one_header_line_from_list(header_list,header_index)
   return translated_header_line_list