[ARVADOS] updated: c42ccd1f88e75b7910623581fbdf8d88c42b55dd

git at public.curoverse.com git at public.curoverse.com
Thu Apr 30 14:21:44 EDT 2015


Summary of changes:
 sdk/python/arvados/arvfile.py    |  2 +-
 sdk/python/tests/test_arvfile.py | 15 +++++----------
 sdk/python/tests/test_stream.py  |  2 +-
 3 files changed, 7 insertions(+), 12 deletions(-)

       via  c42ccd1f88e75b7910623581fbdf8d88c42b55dd (commit)
      from  4570521e9d639806b1f25c93822d5cf0dbfe42d0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c42ccd1f88e75b7910623581fbdf8d88c42b55dd
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Apr 30 14:21:41 2015 -0400

    5856: Tweak tests.  Fix typo.

diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index ff900b7..f43caf3 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -717,7 +717,7 @@ class ArvadosFile(object):
 
 
     def readfrom(self, offset, size, num_retries, exact=False):
-        """Read upto `size` bytes from the file starting at `offset`.
+        """Read up to `size` bytes from the file starting at `offset`.
 
         :exact:
          If False (default), return less data than requested if the read
diff --git a/sdk/python/tests/test_arvfile.py b/sdk/python/tests/test_arvfile.py
index 4e7dd75..1701aa4 100644
--- a/sdk/python/tests/test_arvfile.py
+++ b/sdk/python/tests/test_arvfile.py
@@ -440,24 +440,19 @@ class ArvadosFileReaderTestCase(StreamFileReaderTestCase):
         af = ArvadosFile(ArvadosFileReaderTestCase.MockParent(blocks, nocache), stream=stream, segments=[Range(1, 0, 3), Range(6, 3, 3), Range(11, 6, 3)])
         return ArvadosFileReader(af, "count.txt")
 
-    def test_read_crosses_blocks(self):
+    def test_read_block_crossing_behavior(self):
         # read() needs to return all the data requested if possible, even if it
         # crosses uncached blocks: https://arvados.org/issues/5856
         sfile = self.make_count_reader(nocache=True)
         self.assertEqual('12345678', sfile.read(8))
 
-    def test_read_returns_first_block(self):
-        # Override StreamFileReaderTestCase.test_read_returns_first_block
-        sfile = self.make_count_reader(nocache=True)
-        self.assertEqual('123', sfile.arvadosfile.readfrom(0, 10, 0))
-
     def test_successive_reads(self):
         # Override StreamFileReaderTestCase.test_successive_reads
         sfile = self.make_count_reader(nocache=True)
-        self.assertEqual('123', sfile.arvadosfile.readfrom(0, 10, 0))
-        self.assertEqual('456', sfile.arvadosfile.readfrom(3, 10, 0))
-        self.assertEqual('789', sfile.arvadosfile.readfrom(6, 10, 0))
-        self.assertEqual('', sfile.arvadosfile.readfrom(9, 10, 0))
+        self.assertEqual('1234', sfile.read(4))
+        self.assertEqual('5678', sfile.read(4))
+        self.assertEqual('9', sfile.read(4))
+        self.assertEqual('', sfile.read(4))
 
     def test_tell_after_block_read(self):
         # Override StreamFileReaderTestCase.test_tell_after_block_read
diff --git a/sdk/python/tests/test_stream.py b/sdk/python/tests/test_stream.py
index e90f602..6c3bd61 100644
--- a/sdk/python/tests/test_stream.py
+++ b/sdk/python/tests/test_stream.py
@@ -21,7 +21,7 @@ class StreamFileReaderTestCase(unittest.TestCase):
         return StreamFileReader(stream, [Range(1, 0, 3), Range(6, 3, 3), Range(11, 6, 3)],
                                 'count.txt')
 
-    def test_read_returns_first_block(self):
+    def test_read_block_crossing_behavior(self):
         # read() calls will be aligned on block boundaries - see #3663.
         sfile = self.make_count_reader()
         self.assertEqual('123', sfile.read(10))

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list