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 committed Jun 26, 2024
1 parent df55f75 commit 7066591
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 @@ -3,6 +3,7 @@
"""Tests suite for scp."""

import uuid
import os

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 7066591

Please sign in to comment.