Skip to content

Commit

Permalink
Adding test capturing desired behavior and demonstrating issue parami…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 4, 2013
1 parent 3a9119d commit a3fe422
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import sys
import threading
import unittest
import StringIO

import paramiko
from stub_sftp import StubServer, StubSFTPServer
Expand Down Expand Up @@ -724,3 +725,16 @@ def XXX_test_M_seek_append(self):
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)

0 comments on commit a3fe422

Please sign in to comment.