Example #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()
Example #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()
Example #3
0
def test_missing_file_in_miz(missing_file):
    missing = Miz(missing_file)
    with pytest.raises(FileNotFoundError):
        missing.unzip()
Example #4
0
def test_is_unzipped(test_file):
    mis = Miz(test_file)
    assert not mis.zip_content
    mis.unzip()
    assert mis.zip_content
Example #5
0
def test_decode(test_file):
    miz = Miz(test_file)
    miz.unzip()
    miz.decode()
Example #6
0
def test_unzip(test_file):
    miz = Miz(test_file)
    miz.unzip()
def test_large_decode(large_file):
    miz = Miz(large_file)
    miz.unzip()
    miz.decode()