예제 #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 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()
예제 #3
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)
예제 #4
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
예제 #5
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)
예제 #6
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