tests: Add test for extended arguments to stream .write() method.
This commit is contained in:
parent
ad9b9c7621
commit
0b52228739
25
tests/io/write_ext.py
Normal file
25
tests/io/write_ext.py
Normal 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())
|
5
tests/io/write_ext.py.exp
Normal file
5
tests/io/write_ext.py.exp
Normal file
@ -0,0 +1,5 @@
|
||||
b'fo'
|
||||
b'fofoo'
|
||||
b'fofoooob'
|
||||
b'fofooooboobar'
|
||||
b'fofooooboobar'
|
Loading…
x
Reference in New Issue
Block a user