def test_image_files_found(self): """ Test to see if the number of image files detected is correct. """ hash_value_dict = hash_images(self.directory_path) hash_value_dict.pop(None, None) self.assertEqual(len(reduce(set.union, hash_value_dict.values())), 24)
def do_hash_images(self, args): for arg in args.get("directory_paths"): # Data for each directory is stored in a folder named after the directory path's hash value. directory_data = DirectoryYAML(self.__data_directory_path(arg)) if directory_data.image_hashes is None: directory_data.image_hashes = hash_images(arg) # Save the results to a file. directory_data.save()
def test_non_image_files_found(self): """ Test to see if the number of non-image files detected is correct. """ self.assertEqual(len(hash_images(self.directory_path)[None]), 2)