Ejemplo n.º 1
0
def _find_weka():
    """
    Look for Weka installation in system $PATH or /Applications. If
    not found, return None.
    """
    mac_path = '/Applications/Weka.app'
    linux_path = system.which('weka')
    return mac_path if fs.exists(mac_path) else linux_path
Ejemplo n.º 2
0
 def test_which_path(self):
     self._test("/bin/sh", system.which("sh", path=("/usr", "/bin")))
     self._test(None, system.which("sh", path=("/dev",)))
     self._test(None, system.which("sh", path=("/not-a-real-path",)))
     self._test(None, system.which("not-a-real-command", path=("/bin",)))
Ejemplo n.º 3
0
 def test_which(self):
     self._test("/bin/sh", system.which("sh"))
     self._test(None, system.which("not-a-real-command"))
Ejemplo n.º 4
0
def test_which_path():
  assert system.which("sh", path=("/usr", "/bin")) == "/bin/sh"
  assert not system.which("sh", path=("/dev",))
  assert not system.which("sh", path=("/not-a-real-path",))
  assert not system.which("not-a-real-command", path=("/bin",))
Ejemplo n.º 5
0
def test_which():
  assert "/bin/sh" == system.which("sh")
  assert not system.which("not-a-real-command")