@@ -803,10 +803,8 @@ def test_use_ssh_config_port_value_provided_in_the_config(self, mock_sshclient):
803
803
call_kwargs = mock_client .connect .call_args [1 ]
804
804
self .assertEqual (call_kwargs ['port' ], 9999 )
805
805
806
- @patch ('paramiko.SSHClient' , Mock )
807
806
@patch .object (ParamikoSSHClient , '_is_key_file_needs_passphrase' ,
808
807
MagicMock (return_value = False ))
809
-
810
808
def test_socket_closed (self ):
811
809
conn_params = {'hostname' : 'dummy.host.org' ,
812
810
'username' : 'ubuntu' ,
@@ -823,14 +821,14 @@ def test_socket_closed(self):
823
821
ssh_client .socket = Mock ()
824
822
825
823
# Make sure we havent called any close methods at this point
824
+ # TODO: Replace these with .assert_not_called() once it's Python 3.6+ only
826
825
self .assertEqual (ssh_client .socket .process .kill .call_count , 0 )
827
826
self .assertEqual (ssh_client .socket .process .poll .call_count , 0 )
828
827
829
828
# Call the function that has changed
830
829
ssh_client .close ()
831
830
832
831
# Make sure we have called kill and poll
832
+ # TODO: Replace these with .assert_called_once() once it's Python 3.6+ only
833
833
self .assertEqual (ssh_client .socket .process .kill .call_count , 1 )
834
834
self .assertEqual (ssh_client .socket .process .poll .call_count , 1 )
835
-
836
-
0 commit comments