Permalink
Browse files

code style and fix test.

  • Loading branch information...
1 parent d268594 commit f67cea44d07414806b37905bd58c589d6a48a0df Robey Pointer committed Apr 14, 2010
Showing with 9 additions and 5 deletions.
  1. +5 −1 paramiko/sftp_client.py
  2. +4 −4 tests/test_sftp.py
View
@@ -533,7 +533,7 @@ def getcwd(self):
"""
return self._cwd
- def put(self, localpath, remotepath, callback=None, confirm = True):
+ def put(self, localpath, remotepath, callback=None, confirm=True):
"""
Copy a local file (C{localpath}) to the SFTP server as C{remotepath}.
Any exception raised by operations will be passed through. This
@@ -549,6 +549,10 @@ def put(self, localpath, remotepath, callback=None, confirm = True):
transferred so far and the total bytes to be transferred
(since 1.7.4)
@type callback: function(int, int)
+ @param confirm: whether to do a stat() on the file afterwards to
+ confirm the file size (since 1.7.7)
+ @type confirm: bool
+
@return: an object containing attributes about the given file
(since 1.7.4)
@rtype: SFTPAttributes
View
@@ -667,9 +667,10 @@ def test_M_bad_readv(self):
f.close()
finally:
sftp.unlink(FOLDER + '/zero')
+
def test_N_put_without_confirm(self):
"""
- verify that get/put work.
+ verify that get/put work without confirmation.
"""
import os, warnings
warnings.filterwarnings('ignore', 'tempnam.*')
@@ -682,10 +683,9 @@ def test_N_put_without_confirm(self):
saved_progress = []
def progress_callback(x, y):
saved_progress.append((x, y))
- res = sftp.put(localname, FOLDER + '/bunny.txt', progress_callback, false)
-
- self.assertEquals(SFTPAttributes(), res)
+ res = sftp.put(localname, FOLDER + '/bunny.txt', progress_callback, False)
+ self.assertEquals(SFTPAttributes().attr, res.attr)
f = sftp.open(FOLDER + '/bunny.txt', 'r')
self.assertEquals(text, f.read(128))

0 comments on commit f67cea4

Please sign in to comment.