summaryrefslogtreecommitdiff
path: root/tests/io/bytesio_ext.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-29 23:00:25 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-29 23:00:25 +0300
commitabd5a57ea1e9f756690f6bad9ddc915cf30de42e (patch)
treebaffb7c9138d4099055d5759b7eee5e295e26c4b /tests/io/bytesio_ext.py
parent3990b1715d88196861caf36cbbde3997be6ccdba (diff)
tests/io/bytesio_ext: Test for .seek()/.flush() on BytesIO.
Diffstat (limited to 'tests/io/bytesio_ext.py')
-rw-r--r--tests/io/bytesio_ext.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/io/bytesio_ext.py b/tests/io/bytesio_ext.py
new file mode 100644
index 000000000..30d79fcfc
--- /dev/null
+++ b/tests/io/bytesio_ext.py
@@ -0,0 +1,19 @@
+# Extended stream operations on io.BytesIO
+try:
+ import uio as io
+except ImportError:
+ import io
+
+a = io.BytesIO()
+print(a.seek(8))
+a.write(b"123")
+print(a.getvalue())
+
+print(a.seek(0, 1))
+
+print(a.seek(-1, 2))
+a.write(b"0")
+print(a.getvalue())
+
+a.flush()
+print(a.getvalue())