def test_attack_generate_params(attack, random_image, accurate_class, art_warning):
    """
    Test attacking neural network and generating adversarial objects.
    """
    try:
        adv_laser, adv_class = attack.generate_parameters(np.expand_dims(random_image, 0), np.array([accurate_class]))[
            0
        ]

        assert adv_class != accurate_class
        assert adv_laser is not None
    except ARTTestException as _e:
        art_warning(_e)

    Test attacking neural network and generating adversarial objects.
    
tests/attacks/evasion/test_laser_attack.py