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)
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)