Ensure executable exists when checking encoding for a program
This commit is contained in:
parent
ef668ddc94
commit
017f9a155c
|
@ -56,7 +56,6 @@ class ArchiveTest (unittest.TestCase):
|
||||||
|
|
||||||
def archive_test (self, filename):
|
def archive_test (self, filename):
|
||||||
archive = os.path.join(datadir, filename)
|
archive = os.path.join(datadir, filename)
|
||||||
print "XXX1", self.program
|
|
||||||
patoolib._handle_archive(archive, 'test', program=self.program)
|
patoolib._handle_archive(archive, 'test', program=self.program)
|
||||||
patoolib._handle_archive(archive, 'test', program=self.program, verbose=True)
|
patoolib._handle_archive(archive, 'test', program=self.program, verbose=True)
|
||||||
|
|
||||||
|
@ -99,6 +98,8 @@ def needs_codec (program, codec):
|
||||||
"""Decorator skipping test if given program codec is not available."""
|
"""Decorator skipping test if given program codec is not available."""
|
||||||
def check_prog (f):
|
def check_prog (f):
|
||||||
def newfunc (*args, **kwargs):
|
def newfunc (*args, **kwargs):
|
||||||
|
if not find_executable(program):
|
||||||
|
raise nose.SkipTest("program `%s' not available" % program)
|
||||||
if not find_codec(program, codec):
|
if not find_codec(program, codec):
|
||||||
raise nose.SkipTest("codec `%s' for program `%s' not available" % (codec, program))
|
raise nose.SkipTest("codec `%s' for program `%s' not available" % (codec, program))
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue