Skip to content

Instantly share code, notes, and snippets.

@zerok
Created May 17, 2015 18:02
Show Gist options
  • Save zerok/8880cf0db30c4419ac02 to your computer and use it in GitHub Desktop.
Save zerok/8880cf0db30c4419ac02 to your computer and use it in GitHub Desktop.
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index 6a514ac..9b7146d 100644
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -75,6 +75,13 @@ def test_sftpserver_write_offset_unsupported(content, sftpclient):
f.write("test")
+def test_sftpserver_put_file(content, sftpclient, tmpdir):
+ tmpfile = tmpdir.join('test.txt')
+ tmpfile.write('Hello world')
+ sftpclient.put(str(tmpfile), '/a/test.txt')
+ assert set(sftpclient.listdir('/a')) == set(['test.txt', 'b', 'c', 'f'])
+
+
def test_sftpserver_put_file_dict(content, sftpclient):
with sftpclient.open("/e", 'w') as f:
f.write("testfile4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment