Exemplo n.º 1
0
def test_delete_archive_internal():
    config = InsightsConfig(keep_archive=True)
    arch = InsightsArchive()
    _delete_archive_internal(config, arch)
    assert os.path.exists(arch.tmp_dir)
    assert os.path.exists(arch.archive_tmp_dir)

    config.keep_archive = False
    _delete_archive_internal(config, arch)
    assert not os.path.exists(arch.tmp_dir)
    assert not os.path.exists(arch.archive_tmp_dir)
Exemplo n.º 2
0
def test_cleanup_tmp():
    config = InsightsConfig(keep_archive=True)
    arch = InsightsArchive(config)
    arch.cleanup_tmp()
    assert not os.path.exists(arch.tmp_dir)
    assert os.path.exists(arch.archive_tmp_dir)

    config.keep_archive = False
    arch.cleanup_tmp()
    assert not os.path.exists(arch.tmp_dir)
    assert not os.path.exists(arch.archive_tmp_dir)