tests: Add test for extended arguments to stream .write() method.

This commit is contained in:
Paul Sokolovsky 2016-07-14 11:48:15 +03:00
parent ad9b9c7621
commit 0b52228739
2 changed files with 30 additions and 0 deletions

25
tests/io/write_ext.py Normal file
View File

@ -0,0 +1,25 @@
import uio
try:
uio.BytesIO
except AttributeError:
import sys
print('SKIP')
sys.exit()
buf = uio.BytesIO()
buf.write(b"foo", 2)
print(buf.getvalue())
buf.write(b"foo", 100)
print(buf.getvalue())
buf.write(b"foobar", 1, 3)
print(buf.getvalue())
buf.write(b"foobar", 1, 100)
print(buf.getvalue())
buf.write(b"foobar", 100, 100)
print(buf.getvalue())

View File

@ -0,0 +1,5 @@
b'fo'
b'fofoo'
b'fofoooob'
b'fofooooboobar'
b'fofooooboobar'