def complete(self): return which(self.name) is not None
def test_which(self): self.assertTrue(which('ls') is not None) self.assertTrue(which('ls').endswith('bin/ls')) self.assertTrue(which('veryunlikely1234') is None)