예제 #1
0
파일: ml.py 프로젝트: ChrisCummins/phd
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
예제 #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",)))
예제 #3
0
 def test_which(self):
     self._test("/bin/sh", system.which("sh"))
     self._test(None, system.which("not-a-real-command"))
예제 #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",))
예제 #5
0
def test_which():
  assert "/bin/sh" == system.which("sh")
  assert not system.which("not-a-real-command")