Пример #1
0
 def calls_agent_handler_close_if_enabled(self, Handler, client):
     c = Connection("host", forward_agent=True)
     c.create_session()
     c.close()
     # NOTE: this will need to change if, for w/e reason, we ever want
     # to run multiple handlers at once
     Handler.return_value.close.assert_called_once_with()
Пример #2
0
 def activates_paramiko_agent_forwarding_if_configured(
         self, Handler, client):
     c = Connection("host", forward_agent=True)
     chan = c.create_session()
     Handler.assert_called_once_with(chan)
Пример #3
0
 def calls_open_for_you(self, client):
     c = Connection("host")
     c.open = Mock()
     c.transport = Mock()  # so create_session no asplode
     c.create_session()
     assert c.open.called