summaryrefslogtreecommitdiffstatshomepage
path: root/tests/io/file_readinto.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-18 22:44:07 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-10-18 22:44:07 +0300
commit1a55b6a787ee7a568550ac0510632965af61c9ee (patch)
tree61f49937226e3dfb945adecef74cc1eff3dfc57e /tests/io/file_readinto.py
parentc92672d7f8fc410477a4e25789d15c1fd99b675b (diff)
downloadmicropython-1a55b6a787ee7a568550ac0510632965af61c9ee.tar.gz
micropython-1a55b6a787ee7a568550ac0510632965af61c9ee.zip
unix, stmhal: Implement file.readinto() method.
Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
Diffstat (limited to 'tests/io/file_readinto.py')
-rw-r--r--tests/io/file_readinto.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/io/file_readinto.py b/tests/io/file_readinto.py
new file mode 100644
index 0000000000..7a0603377a
--- /dev/null
+++ b/tests/io/file_readinto.py
@@ -0,0 +1,7 @@
+b = bytearray(30)
+f = open("io/data/file1", "rb")
+print(f.readinto(b))
+print(b)
+f = open("io/data/file2", "rb")
+print(f.readinto(b))
+print(b)