def test_copy_second_time(self): source_dir_test = "./PictureVideoFileOrganizer/unit_test/source_dir/Camera Roll" picture_destination_dir_test = "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures" movie_destination_dir_test = "./PictureVideoFileOrganizer/unit_test/destination_dir/Movies/" test_dir = Directory(source_dir_test, picture_destination_dir_test, movie_destination_dir_test) test_dir.copy_files_to_destination_directory() assert test_dir.directory_path == "./PictureVideoFileOrganizer/unit_test/source_dir/Camera Roll/" assert test_dir.picture_destination_directory == "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/" assert test_dir.movie_destination_directory == "./PictureVideoFileOrganizer/unit_test/destination_dir/Movies/" assert len(test_dir.files) == 8 assert test_dir.files_copied == 0 assert test_dir.files_not_copied == 8 assert test_dir.files_with_date_found == 4 assert test_dir.files_without_date_found == 4 test_files = { "IMG_6084.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/no_date_available", "IMG_6272.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/no_date_available", "IMG_6285.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/2015-07-17", "IMG_6296.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/2015-07-17", "IMG_6367.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/no_date_available", "IMG_6385.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/no_date_available", "IMG_6781.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/2015-08-06", "IMG_6784.JPG" : "./PictureVideoFileOrganizer/unit_test/destination_dir/Pictures/2015-08-06" } for key, value in test_files.items(): assert (key in listdir(value))
} """ Set the destination directories where the pictures will be stored and where the videos will be stored. """ pictures_destination_directory = '/Users/patrickkennedy/Pictures/test_dir' videos_destination_directory = '/Users/patrickkennedy/Movies/test_dir' print ("Picture/Video File Organizer Application...") #Set the start time start_time = datetime.now() for key, value in source_directories.items(): print "Processing files from %s..." % key current_directory = Directory(value, pictures_destination_directory, videos_destination_directory) current_directory.copy_files_to_destination_directory() current_directory.print_details() for key, value in source_directories_camera.items(): print "Processing files from %s..." % key current_directory = DirectoryWithDateSubfolders(value, pictures_destination_directory, videos_destination_directory) current_directory.copy_files_to_destination_directory() current_directory.print_details() #Set the end time end_time = datetime.now() elapsed_time = end_time - start_time print "Elapsed time: %s" % elapsed_time