diff options
author | Sebastian Deiss <sdeiss@haw-landshut.de> | 2014-04-23 14:42:23 +0200 |
---|---|---|
committer | Sebastian Deiss <sdeiss@haw-landshut.de> | 2014-04-23 14:42:23 +0200 |
commit | ce87fc8d7a8a025671183fc78091e5d1f6760f5f (patch) | |
tree | bce8764d8c708567e378d773e9352ee13a62daf6 /tests/test_sftp.py | |
parent | 550f0b99eadf8a366253046acdd944709214123f (diff) | |
parent | 417102dbea0fbe2f7df6c690ee610b2cc2c18b19 (diff) |
Merge branch 'paramiko:master' into gssapi-py3-support
Conflicts:
sites/www/changelog.rst
test.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() |