Skip to content

Commit

Permalink
Use /dev/null @ copy non-existing remote file test
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored and Jakuje committed Jun 27, 2024
1 parent 8d6558c commit 37f9062
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit/scp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"""Tests suite for scp."""

import os
import uuid

import pytest
Expand Down Expand Up @@ -69,8 +70,8 @@ def path_to_non_existent_src_file(tmp_path):
return path


def test_get_missing_src(dst_path, path_to_non_existent_src_file, ssh_scp):
def test_get_missing_src(path_to_non_existent_src_file, ssh_scp):
"""Check that SCP file download raises exception if the remote file is missing."""
error_msg = '^Error receiving information about file:'
with pytest.raises(LibsshSCPException, match=error_msg):
ssh_scp.get(str(path_to_non_existent_src_file), str(dst_path))
ssh_scp.get(str(path_to_non_existent_src_file), os.devnull)

0 comments on commit 37f9062

Please sign in to comment.