diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-04-16 15:24:04 -0400 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-04-16 15:24:04 -0400 |
commit | ba017e9e6c0fd870d37c83a4bba49c08c125a0ab (patch) | |
tree | 61c2dbba354ae82f0a987d89ae3dfb8d66c65b4d /tests/test_sftp.py | |
parent | 6dee34648ed7d910464c7f2bbc27f361c9fe6d71 (diff) | |
parent | a0b2ae293ffedcad45883e8a4d04fc067f919d15 (diff) |
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-x | tests/test_sftp.py | 17 |
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() |