Exemplo n.º 1
0
def test_compress_file_list(mock_shutil, mock_gzip_open, mock_open, mock_remove):
    res = compress_file_list([])
    assert res == []
    res = compress_file_list(["input1"])
    assert res == ["input1.gz"]
    res = compress_file_list(["input1", "input2"])
    assert res == ["input1.gz", "input2.gz"]
def test_compress_file_list_exception(mock_shutil, mock_gzip_open, mock_open,
                                      mock_remove):
    mock_shutil.side_effect = Exception("SomeException")
    with pytest.raises(CompressionError):
        compress_file_list(["input1", "input2"])