from exploits.bombs.images import jpeg_bomb
from test.exploits.dummy_output import DummyOutput


def test_jpeg_bombs():
    size = range(10, 61, 10)
    color_scale = ['gray', 'rgb']

    for s in size:
        for c in color_scale:
            output = DummyOutput()
            jpeg_bomb.options['size'] = s
            jpeg_bomb.options['color'] = c
            jpeg_bomb.run(output)
            assert len(output) == 1
