Exemple #1
0
def test_temp_dir_cleaning(test_file):
    mis = Miz(test_file)
    mis.unzip()
    assert mis.temp_dir.exists()
    assert mis.temp_dir.glob('*')
    mis._remove_temp_dir()
    assert not mis.temp_dir.exists()
Exemple #2
0
def test_bad_zip_file(bad_zip_file):
    from zipfile import BadZipFile
    mis = Miz(bad_zip_file)
    with pytest.raises(BadZipFile):
        mis.unzip()
Exemple #3
0
def test_missing_file_in_miz(missing_file):
    missing = Miz(missing_file)
    with pytest.raises(FileNotFoundError):
        missing.unzip()
Exemple #4
0
def test_is_unzipped(test_file):
    mis = Miz(test_file)
    assert not mis.zip_content
    mis.unzip()
    assert mis.zip_content
Exemple #5
0
def test_decode(test_file):
    miz = Miz(test_file)
    miz.unzip()
    miz.decode()
Exemple #6
0
def test_unzip(test_file):
    miz = Miz(test_file)
    miz.unzip()
Exemple #7
0
def test_large_decode(large_file):
    miz = Miz(large_file)
    miz.unzip()
    miz.decode()