diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-04-16 15:24:09 -0400 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-04-16 15:24:09 -0400 |
commit | 1b796861aad28572ba5c5dec529c3c4c906e6005 (patch) | |
tree | e4d5e5969f4bf1213848c0d0c1e984af7cb79f1f /tests/test_sftp.py | |
parent | c14de1d93516c9aec18749cb501febf0b2cee530 (diff) | |
parent | ba017e9e6c0fd870d37c83a4bba49c08c125a0ab (diff) |
Merge branch '1.13'
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() |