Skip to content

Commit

Permalink
downland delete progress_bar (#554)
Browse files Browse the repository at this point in the history
* downland delete progress_bar

* downland delete progress_bar
  • Loading branch information
wayyoungboy authored Nov 14, 2024
1 parent f48a0b0 commit 7637458
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/ssh_client/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def download(self, remote_path, local_path):
transport = self._ssh_fd.get_transport()
self._sftp_client = paramiko.SFTPClient.from_transport(transport)
self.stdio.verbose('Download {0}:{1}'.format(self.host_ip, remote_path))
self._sftp_client.get(remote_path, local_path, callback=self.progress_bar)
self._sftp_client.get(remote_path, local_path)
self._sftp_client.close()

def progress_bar(self, transferred, to_be_transferred, suffix=''):
Expand Down
4 changes: 2 additions & 2 deletions test/common/ssh_client/test_remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_download_success(self, mock_from_transport):
self.remote_client.download(remote_path, local_path)

# Verify that the get method was called once with the correct parameters during the download process
self.remote_client._sftp_client.get.assert_called_once_with(remote_path, local_path, callback=self.remote_client.progress_bar)
self.remote_client._sftp_client.get.assert_called_once_with(remote_path, local_path)

# Verify that the close method was called once after the download completes
self.remote_client._sftp_client.close.assert_called_once()
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_download_failure(self, mock_from_transport):
self.remote_client.download(remote_path, local_path)

# Confirm that the get method was called once with the correct parameters
self.remote_client._sftp_client.get.assert_called_once_with(remote_path, local_path, callback=self.remote_client.progress_bar)
self.remote_client._sftp_client.get.assert_called_once_with(remote_path, local_path)

# Manually call the close method to mimic actual behavior
self.remote_client._sftp_client.close()
Expand Down

0 comments on commit 7637458

Please sign in to comment.