ssh: stat -> lstat

This commit is contained in:
Mr. Outis
2019-08-31 13:02:17 -05:00
parent 70010bbb31
commit 7b4584f86c
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -60,13 +60,13 @@ class SSHConnection:
def st_mode(self, path):
with ignore_file_not_found():
return self.sftp.stat(path).st_mode
return self.sftp.lstat(path).st_mode
return 0
def getsize(self, path):
with ignore_file_not_found():
return self.sftp.stat(path).st_size
return self.sftp.lstat(path).st_size
return 0
+3 -1
View File
@@ -81,7 +81,9 @@ def test_walk(tmp_path, ssh):
reason="Only works on OSX (because of APFS)")
def test_reflink(chdir_tmp, foo, ssh):
ssh.reflink("foo", "bar")
assert System.is_reflink(bar_path)
assert filecmp.cmp("foo", "bar")
assert not System.is_symlink("bar")
assert not System.is_hardlink("bar")
@pytest.mark.skip(reason="MockSSH doesn't support symlinks")
def test_symlink(chdir_tmp, foo, ssh):