def test_open_archive_7z(self):
    'Test open_archive with 7za if installed.'
    FAILED_TO_OPEN_7ZA = 'Unexpected STDERR output from 7za '
    try:
        subprocess.Popen(['7za'], stdout=subprocess.PIPE).stdout.close()
    except OSError:
        raise unittest.SkipTest('7za not installed')
    self.assertEqual(self._get_content((self.base_file + '.7z')), self.original_content)
    self.assertRaisesRegex(OSError, FAILED_TO_OPEN_7ZA, self._get_content, (self.base_file + '_invalid.7z'), use_extension=True)
Test open_archive with 7za if installed.
def test_open_archive_7z(self):
    
    FAILED_TO_OPEN_7ZA = 'Unexpected STDERR output from 7za '
    try:
        subprocess.Popen(['7za'], stdout=subprocess.PIPE).stdout.close()
    except OSError:
        raise unittest.SkipTest('7za not installed')
    self.assertEqual(self._get_content((self.base_file + '.7z')), self.original_content)
    self.assertRaisesRegex(OSError, FAILED_TO_OPEN_7ZA, self._get_content, (self.base_file + '_invalid.7z'), use_extension=True)