[ARVADOS] created: fc308658aeeeb007fa3eb710b4bdc9179a13db10

git at public.curoverse.com git at public.curoverse.com
Tue Jan 26 09:44:12 EST 2016


        at  fc308658aeeeb007fa3eb710b4bdc9179a13db10 (commit)


commit fc308658aeeeb007fa3eb710b4bdc9179a13db10
Author: radhika <radhika at curoverse.com>
Date:   Mon Jan 25 16:37:24 2016 -0500

    7852: add a failing test that does: readline and then readlines. The expectation would be the second call,
    readlines, would fetch all the remaining lines after the first line. However, the readlines call is only
    fetching the data after the "first block" which was read during the first readline call. It appears that
    self._readline_cache and self._filepos are playing a role here, which are set during the first readline.

diff --git a/sdk/python/tests/test_stream.py b/sdk/python/tests/test_stream.py
index 6c3bd61..2c31ef9 100644
--- a/sdk/python/tests/test_stream.py
+++ b/sdk/python/tests/test_stream.py
@@ -184,6 +184,13 @@ class StreamFileReaderTestCase(unittest.TestCase):
     def test_bz2_decompression(self):
         self.check_decompression('bz2', bz2.compress)
 
+    def test_readline_then_readlines(self):
+        reader = self.make_newlines_reader()
+        data = reader.readline()
+        self.assertEqual('one\n', data)
+        data = reader.readlines()
+        self.assertEqual(['two\n', '\n', 'three\n', 'four\n', '\n'], data)
+
 
 class StreamRetryTestMixin(object):
     # Define reader_for(coll_name, **kwargs)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list