Exemplo n.º 1
0
 def test_does_not_find_executable(self):
     exists = FakeExists(['/bin/foo'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path is None
Exemplo n.º 2
0
 def test_finds_absolute_paths(self):
     exists = FakeExists(['/bin/ls'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path == '/bin/ls'
Exemplo n.º 3
0
 def test_does_not_find_executable(self):
     exists = FakeExists(['/bin/foo'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path is None
Exemplo n.º 4
0
 def test_finds_absolute_paths(self):
     exists = FakeExists(['/bin/ls'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path == '/bin/ls'
Exemplo n.º 5
0
 def test_executable_exists_as_file(self, monkeypatch):
     monkeypatch.setattr(remotes.os.path, 'exists', lambda x: True)
     monkeypatch.setattr(remotes.os.path, 'isfile', lambda x: True)
     assert remotes.which('foo') == '/usr/local/bin/foo'
Exemplo n.º 6
0
 def test_executable_does_not_exist(self, monkeypatch):
     monkeypatch.setattr(remotes.os.path, 'exists', lambda x: False)
     monkeypatch.setattr(remotes.os.path, 'isfile', lambda x: True)
     assert remotes.which('foo') is None