diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2014-07-05 23:51:38 +0200 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-08-25 22:03:51 -0700 |
commit | c3ba66b90e9da0cce9c88fbc45894fde492edfd0 (patch) | |
tree | 495abda8950a14f239cf486cef525adad4954fbe /tests | |
parent | 23c03b812242736bbfa1bf2e7780911ff180aaae (diff) |
Support passing in "buffer" objects again where bytestrings are expected.
This fixes bzr's use of paramiko.
Fixes issue #343/#285.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_file.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_file.py b/tests/test_file.py index c6edd7af..22a34aca 100755 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -23,6 +23,7 @@ Some unit tests for the BufferedFile abstraction. import unittest from paramiko.file import BufferedFile from paramiko.common import linefeed_byte, crlf, cr_byte +import sys class LoopbackFile (BufferedFile): @@ -151,6 +152,15 @@ class BufferedFileTest (unittest.TestCase): b'need to close them again.\n') f.close() + def test_8_buffering(self): + """ + verify that buffered objects can be written + """ + if sys.version_info[0] == 2: + f = LoopbackFile('r+', 16) + f.write(buffer(b'Too small.')) + f.close() + if __name__ == '__main__': from unittest import main main() |