@require_modules('bz2file')
def test_open_archive_with_bz2file(self):
    'Test open_archive when bz2file library.'
    old_bz2 = tools.bz2
    try:
        tools.bz2 = __import__('bz2file')
        self.assertEqual(self._get_content((self.base_file + '.bz2')), self.original_content)
        self.assertEqual(self._get_content((self.base_file + '.bz2'), use_extension=False), self.original_content)
    finally:
        tools.bz2 = old_bz2
Test open_archive when bz2file library.
@require_modules('bz2file')
def test_open_archive_with_bz2file(self):
    
    old_bz2 = tools.bz2
    try:
        tools.bz2 = __import__('bz2file')
        self.assertEqual(self._get_content((self.base_file + '.bz2')), self.original_content)
        self.assertEqual(self._get_content((self.base_file + '.bz2'), use_extension=False), self.original_content)
    finally:
        tools.bz2 = old_bz2