summaryrefslogtreecommitdiff
path: root/tests/test_sftp.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2014-04-16 15:24:04 -0400
committerJeff Forcier <jeff@bitprophet.org>2014-04-16 15:24:04 -0400
commitba017e9e6c0fd870d37c83a4bba49c08c125a0ab (patch)
tree61c2dbba354ae82f0a987d89ae3dfb8d66c65b4d /tests/test_sftp.py
parent6dee34648ed7d910464c7f2bbc27f361c9fe6d71 (diff)
parenta0b2ae293ffedcad45883e8a4d04fc067f919d15 (diff)
downloadparamiko-ba017e9e6c0fd870d37c83a4bba49c08c125a0ab.tar.gz
Merge branch '1.12' into 1.13
Conflicts: paramiko/sftp_client.py sites/www/changelog.rst tests/test_sftp.py
Diffstat (limited to 'tests/test_sftp.py')
-rwxr-xr-xtests/test_sftp.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index 6417ac90..e0534eb0 100755
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -37,6 +37,7 @@ from paramiko.common import o777, o600, o666, o644
from tests.stub_sftp import StubServer, StubSFTPServer
from tests.loop import LoopSocket
from tests.util import test_path
+import paramiko.util
from paramiko.sftp_attr import SFTPAttributes
ARTICLE = '''
@@ -732,7 +733,23 @@ class SFTPTest (unittest.TestCase):
sftp.remove(target)
+ def test_N_file_with_percent(self):
+ """
+ verify that we can create a file with a '%' in the filename.
+ ( it needs to be properly escaped by _log() )
+ """
+ self.assertTrue( paramiko.util.get_logger("paramiko").handlers, "This unit test requires logging to be enabled" )
+ f = sftp.open(FOLDER + '/test%file', 'w')
+ try:
+ self.assertEqual(f.stat().st_size, 0)
+ finally:
+ f.close()
+ sftp.remove(FOLDER + '/test%file')
+
+
if __name__ == '__main__':
SFTPTest.init_loopback()
+ # logging is required by test_N_file_with_percent
+ paramiko.util.log_to_file('test_sftp.log')
from unittest import main
main()