def test_when_cmd_found_returns_path(self): self.assertEqual(os.path.split(which('ls'))[-1], 'ls')
def test_when_cmd_not_found_returns_none(self): self.assertIsNone(which('a-tool-that-doesnt-exist'))