diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-03-04 08:45:00 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-03-04 08:45:00 -0500 |
commit | a3fe422198b1faf75afaf8e2ccfc752dcba64c82 (patch) | |
tree | 16839b1a45fd34702cb9ffb12fb5843c1c84dcb6 /tests | |
parent | 3a9119d78a8745e4e45bea0881bfae3deb2adab3 (diff) |
Adding test capturing desired behavior and demonstrating issue #142.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_sftp.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index dfd673a9..b1697ea6 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -31,6 +31,7 @@ import warnings import sys import threading import unittest +import StringIO import paramiko from stub_sftp import StubServer, StubSFTPServer @@ -724,3 +725,16 @@ class SFTPTest (unittest.TestCase): f.close() finally: sftp.remove(FOLDER + '/append.txt') + + def test_putfo_empty_file(self): + """ + Send an empty file and confirm it is sent. + """ + target = FOLDER + '/empty file.txt' + stream = StringIO.StringIO() + try: + attrs = sftp.putfo(stream, target) + # the returned attributes should not be null + self.assertNotEqual(attrs, None) + finally: + sftp.remove(target) |