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))
 def test_read_file_name_from_populated_directory(self):
   directory_object = read_directory(
     "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish")
   matching = [s for s in directory_object.filelist if ".htm" in s]
   self.assertTrue(matching[0] == 'Gordon_Hamersley_s_Boned_Stuffed_Leg_of_Lamb_1.htm')
 def getRecipeList(self):
   directory_object = read_directory(
     "C:\Documents and Settings\All Users\Documents\My BigOven Recipes\Publish")
   matching = [s for s in directory_object.filelist if ".htm" in s]
   return matching
 def assertCountEqual(self, input_directory, expected_count):
   directory_object = read_directory(input_directory)
   matching = [s for s in directory_object.filelist if ".htm" in s]
   self.assertEqual(len(matching),expected_count)