from exploits.bombs.compression import zip
from test.exploits.dummy_output import DummyOutput

# TODO check that the output meets the input requirements


def test_small_single_layer_bomb():
    output = DummyOutput()
    zip.options['type'] = 'single_layer'
    zip.options['target_size'] = 1000
    zip.run(output)
    assert len(output) == 1


def test_large_single_layer_bomb():
    output = DummyOutput()
    zip.options['type'] = 'single_layer'
    zip.options['target_size'] = 1000000
    zip.run(output)
    assert len(output) == 1


def test_multi_layer_bomb():
    output = DummyOutput()
    zip.options['type'] = 'layer'
    zip.options['target_size'] = 1000000
    zip.options['n_layers'] = 5
    zip.run(output)
    assert len(output) == 1


def test_recursive_bomb():
    output = DummyOutput()
    zip.options['type'] = 'recursive'
    zip.run(output)
    assert len(output) == 1
