def test_open_archive_without_bz2(self):
    'Test open_archive when bz2 and bz2file are not available.'
    old_bz2 = tools.bz2
    BZ2_IMPORT_ERROR = 'This is a fake exception message that is used when bz2 and bz2file is not importable'
    try:
        tools.bz2 = ImportError(BZ2_IMPORT_ERROR)
        self.assertRaisesRegex(ImportError, BZ2_IMPORT_ERROR, self._get_content, (self.base_file + '.bz2'))
    finally:
        tools.bz2 = old_bz2
Test open_archive when bz2 and bz2file are not available.
def test_open_archive_without_bz2(self):
    
    old_bz2 = tools.bz2
    BZ2_IMPORT_ERROR = 'This is a fake exception message that is used when bz2 and bz2file is not importable'
    try:
        tools.bz2 = ImportError(BZ2_IMPORT_ERROR)
        self.assertRaisesRegex(ImportError, BZ2_IMPORT_ERROR, self._get_content, (self.base_file + '.bz2'))
    finally:
        tools.bz2 = old_bz2