コード例 #1
0
ファイル: test_remotes.py プロジェクト: ceph/ceph-deploy
 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
コード例 #2
0
ファイル: test_remotes.py プロジェクト: ceph/ceph-deploy
 def test_finds_absolute_paths(self):
     exists = FakeExists(['/bin/ls'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path == '/bin/ls'
コード例 #3
0
ファイル: test_remotes.py プロジェクト: zhaoqinhu/ceph-deploy
 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
コード例 #4
0
ファイル: test_remotes.py プロジェクト: zhaoqinhu/ceph-deploy
 def test_finds_absolute_paths(self):
     exists = FakeExists(['/bin/ls'])
     with patch(self.exists_module, exists):
         path = remotes.which('ls')
     assert path == '/bin/ls'
コード例 #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'
コード例 #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