def test_if_random_laser_beam_is_in_ranges(laser_generator, min_laser_beam, max_laser_beam, less_or_equal, art_warning):
    """
    Test if random laser beam is in defined ranges.
    """
    try:
        for _ in range(100):
            random_laser = laser_generator.random()
            np.testing.assert_array_compare(less_or_equal, random_laser.to_numpy(), max_laser_beam.to_numpy())
            np.testing.assert_array_compare(less_or_equal, min_laser_beam.to_numpy(), random_laser.to_numpy())
    except ARTTestException as _e:
        art_warning(_e)

    Test if random laser beam is in defined ranges.
    
tests/attacks/evasion/test_laser_attack.py