Exemplo n.º 1
0
 def test_remove_known_host(self, _check_call, _known_hosts):
     _known_hosts.return_value = '/foo/known_hosts'
     utils.remove_known_host('test')
     _check_call.assert_called_with(
         ['ssh-keygen', '-f', '/foo/known_hosts',
          '-R', 'test'])
     _known_hosts.assert_called_with(None, None)
     utils.remove_known_host('test', 'bar')
     _known_hosts.assert_called_with('bar', None)
 def test_remove_known_host(self, _check_call, _known_hosts):
     _known_hosts.return_value = '/foo/known_hosts'
     utils.remove_known_host('test')
     _check_call.assert_called_with(
         ['ssh-keygen', '-f', '/foo/known_hosts',
          '-R', 'test'])
     _known_hosts.assert_called_with(None, None)
     utils.remove_known_host('test', 'bar')
     _known_hosts.assert_called_with('bar', None)
Exemplo n.º 3
0
 def test_remove_host_key(self, check_call, known_hosts):
     known_hosts.return_value = '/tmp/known_hosts'
     utils.remove_known_host('foo')
     check_call.assert_called_with([
         'ssh-keygen', '-f', known_hosts(), '-R', 'foo'])
 def test_remove_host_key(self, check_call, known_hosts):
     known_hosts.return_value = '/tmp/known_hosts'
     utils.remove_known_host('foo')
     check_call.assert_called_with([
         'ssh-keygen', '-f', known_hosts(), '-R', 'foo'])