Exemplo n.º 1
0
def test_disabled(config):
    t = malware.ClamAVRunner(
        config=config, squashed_tar_path="squashed.tar", tempdir="/tmp"
    )
    out = t.run()
    assert out is not None
    assert out.findings is None
def test_output_handler():
    test_config = {
        'clamav': {'enabled': True}
    }
    fake_path = '/analysis_scratch/123-123-123-123-123/squashed.tar'

    t = malware.ClamAVRunner(config=test_config, squashed_tar_path=fake_path, tempdir='/tmp')
    setattr(t, 'scan', mock_scan)
    setattr(t, 'refresh_db', mock_update)
    output = t.run()
    print(output)
    assert output.name == 'clamav'
    assert len(output.findings) > 0
Exemplo n.º 3
0
def test_output_handler():
    test_config = {"clamav": {"enabled": True}}
    fake_path = "/analysis_scratch/123-123-123-123-123/squashed.tar"

    t = malware.ClamAVRunner(
        config=test_config, squashed_tar_path=fake_path, tempdir="/tmp"
    )
    setattr(t, "scan", mock_scan)
    setattr(t, "refresh_db", mock_update)
    output = t.run()
    print(output)
    assert output.name == "clamav"
    assert len(output.findings) > 0