def test_which_path(): assert "/bin/bash" == emu.which("bash", path=("/usr", "/bin")) assert None == emu.which("ls", path=("/dev",)) assert None == emu.which("ls", path=("/not-a-real-path",)) assert None == emu.which("not-a-real-command", path=("/bin",))
def test_which(): assert "/bin/bash" == emu.which("bash") assert "/bin/bash" == emu.which("/bin/bash") assert None == emu.which("not-a-real-command")
def test_which_path(): assert "/bin/bash" == emu.which("bash", path=("/usr", "/bin")) assert None == emu.which("ls", path=("/dev", )) assert None == emu.which("ls", path=("/not-a-real-path", )) assert None == emu.which("not-a-real-command", path=("/bin", ))
def test_which_path(self): self._test("/bin/ls", emu.which("ls", path=("/usr", "/bin"))) self._test(None, emu.which("ls", path=("/dev",))) self._test(None, emu.which("ls", path=("/not-a-real-path",))) self._test(None, emu.which("not-a-real-command", path=("/bin",)))
def test_which(self): self._test("/bin/ls", emu.which("ls")) self._test("/bin/ls", emu.which("/bin/ls")) self._test(None, emu.which("not-a-real-command"))