def test_suite(): from unittest import TestSuite, makeSuite suite = TestSuite() if bin_search('ris2xml', False) is False: print 'ris2xml not found!' print 'please make sure bibutils is installed to run all tests.' print '-' * 20 else: suite.addTest(makeSuite(TestRISParser)) return suite
def _hasCommands(command): """ Check if a collection of piped commands is available >>> _hasCommands('python -o|python -wrt') True >>> _hasCommands(' something_strange -m | python') False """ for cmd in command.split('|'): cmd = cmd.strip() if ' ' in cmd: cmd = cmd[:cmd.find(' ')] if bin_search(cmd, False) is False: log.warn('Command %s not found in search path!', cmd) return False return True