Skip to content

Commit 0b52228

Browse files
committed
tests: Add test for extended arguments to stream .write() method.
1 parent ad9b9c7 commit 0b52228

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

tests/io/write_ext.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import uio
2+
3+
try:
4+
uio.BytesIO
5+
except AttributeError:
6+
import sys
7+
print('SKIP')
8+
sys.exit()
9+
10+
buf = uio.BytesIO()
11+
12+
buf.write(b"foo", 2)
13+
print(buf.getvalue())
14+
15+
buf.write(b"foo", 100)
16+
print(buf.getvalue())
17+
18+
buf.write(b"foobar", 1, 3)
19+
print(buf.getvalue())
20+
21+
buf.write(b"foobar", 1, 100)
22+
print(buf.getvalue())
23+
24+
buf.write(b"foobar", 100, 100)
25+
print(buf.getvalue())

tests/io/write_ext.py.exp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
b'fo'
2+
b'fofoo'
3+
b'fofoooob'
4+
b'fofooooboobar'
5+
b'fofooooboobar'

0 commit comments

Comments
 (0)