class_docstr: A unittest class for testing Backdoor Poisoning attack.
docstr: Tests failure modes for image perturbation functions
docstr_tok: ["Tests","failure","modes","for","image","perturbation","functions"]
code: def test_image_failure_modes(self):
      """
      Tests failure modes for image perturbation functions
      """
      backdoor_attack = PoisoningAttackBackdoor(self.poison_func_5)
      adv_target = np.argmax(self.y_train_mnist) + 1 % 10
      with self.assertRaises(ValueError) as context:
          backdoor_attack.poison(self.x_train_mnist, y=adv_target)
  
      self.assertIn(
          "Backdoor does not fit inside original image",
          str(context.exception),
      )
  
      backdoor_attack = PoisoningAttackBackdoor(self.poison_func_6)
  
      with self.assertRaises(ValueError) as context:
          backdoor_attack.poison(np.zeros(5), y=np.ones(5))
  
      self.assertIn("Invalid array shape", str(context.exception))
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import os
  import logging
  import unittest
  import numpy
  from art.attacks.poisoning.backdoor_attack import PoisoningAttackBackdoor
  from art.attacks.poisoning.perturbations import add_pattern_bd, add_single_bd, insert_image
  from art.utils import to_categorical
  from tests.utils import TestBase, master_seed, get_image_classifier_kr
label_desc: Use image node_id 13 for calling the TestBackdoorAttack obj's underlying member method code with example usage: obj.test_image_failure_modes() without return types