Commit Graph

22 Commits

Author SHA1 Message Date
Damien George
9dd3640464 tests: Add missing tests for builtins, and many other things. 2015-04-04 22:05:30 +01:00
Damien George
92ab95f215 tests: Add some tests to improve coverage. 2015-01-29 14:56:09 +00:00
Paul Sokolovsky
66b060f3e6 tests: Fix typo in file_long_read3.py. 2015-01-23 19:00:02 +02:00
Paul Sokolovsky
1f04336b23 tests: Add extra test for reading multiple of internal chunk size. 2015-01-23 18:18:11 +02:00
Paul Sokolovsky
220d21e1bf tests: Add testcase for reading amounts bigger than buffer/chunk size. 2015-01-23 16:42:02 +02:00
stijn
bf19541f46 py: Prevent segfault for operations on closed StringIO.
Addresses issue #1067.
2015-01-20 23:50:43 +00:00
Damien George
5694cc5490 py: Make stream seek correctly check for ioctl fn; add seek for textio. 2014-11-16 23:56:37 +00:00
Paul Sokolovsky
c7d5500142 tests: Add test for file.seek(). 2014-11-17 00:16:14 +02:00
Paul Sokolovsky
e2f8d98525 stream: Add optional 2nd "length" arg to .readinto() - extension to CPython.
While extension to file.readinto() definition of CPython, the additional arg
is similar to what in CPython available in socket.recv_into().
2014-10-23 21:43:59 +03:00
stijn
a3efe04dce Use mode/encoding kwargs in io and unicode tests
mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8
2014-10-21 22:10:38 +03:00
Paul Sokolovsky
1a55b6a787 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.
2014-10-18 22:44:07 +03:00
Paul Sokolovsky
512465bc66 tests: Add testcase for read by length past EOF.
Currently broken for unicode input streams.
2014-07-22 00:11:37 +03:00
Damien George
539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00
Paul Sokolovsky
fbdf2f1d63 py: Rename builtin "io" to "_io".
Functionality we provide in builtin io module is fairly minimal. Some
code, including CPython stdlib, depends on more functionality. So, there's
a choice to either implement it in C, or move it _io, and let implement other
functionality in Python. 2nd choice is pursued. This setup matches CPython
too (_io is builtin, io is Python-level).
2014-06-12 01:22:25 +03:00
Damien George
d5f5b2f766 py, stream: Implement readlines for a stream. 2014-05-03 22:01:32 +01:00
Paul Sokolovsky
cb9dc086a3 modio: Implement io.StringIO class. 2014-04-26 20:26:14 +03:00
Paul Sokolovsky
072cf022e0 tests/file-with: Add testcase which failed for @dpgeorge.
Works on x86.
2014-04-04 12:15:39 +03:00
Paul Sokolovsky
c61ce96590 unix file: Implement context manager protocol (for "with" statement). 2014-04-03 22:09:05 +03:00
Paul Sokolovsky
1e19b24ea0 io.File, socket types: Add fileno() method.
Implementation is duplicated, but tolerate this for now, because there's
no clear idea how to de-dup it.
2014-02-08 21:20:32 +02:00
Paul Sokolovsky
decd597273 unix io.FileIO: Add iteration support.
A file cannot be iterated concurrently, so we make io.FileIO its own
iterator.
2014-01-20 18:42:08 +02:00
Paul Sokolovsky
fe2690da0a unix: Implement sys.argv. 2014-01-20 01:00:28 +02:00
Paul Sokolovsky
9954b4b99d Add directory for I/O tests with basic test for file methods. 2014-01-19 18:46:21 +02:00