[ARVADOS] updated: baac22ee9ae8f27a10df875e5f1e17b1b6cd51c8

git at public.curoverse.com git at public.curoverse.com
Tue Jun 2 13:32:24 EDT 2015


Summary of changes:
 sdk/python/arvados/arvfile.py    | 4 +---
 sdk/python/tests/test_arvfile.py | 8 +++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

       via  baac22ee9ae8f27a10df875e5f1e17b1b6cd51c8 (commit)
      from  c766dd2394de3480be2047f4c073e5802a001d07 (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 baac22ee9ae8f27a10df875e5f1e17b1b6cd51c8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Jun 2 13:32:19 2015 -0400

    6194: Make splitting loop simpler since [n:n+KEEP_BLOCK_SIZE] returns a short
    slice when there isn't KEEP_BLOCK_SIZE data.  Update test.

diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index 46c4961..95dcea0 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -788,11 +788,9 @@ class ArvadosFile(object):
             # Chunk it up into smaller writes
             n = 0
             dataview = memoryview(data)
-            while (n + config.KEEP_BLOCK_SIZE) < len(data):
+            while n < len(data):
                 self.writeto(offset+n, dataview[n:n + config.KEEP_BLOCK_SIZE].tobytes(), num_retries)
                 n += config.KEEP_BLOCK_SIZE
-            if n < len(data):
-                self.writeto(offset+n, dataview[n:].tobytes(), num_retries)
             return
 
         self._modified = True
diff --git a/sdk/python/tests/test_arvfile.py b/sdk/python/tests/test_arvfile.py
index 9d8f1df..205c181 100644
--- a/sdk/python/tests/test_arvfile.py
+++ b/sdk/python/tests/test_arvfile.py
@@ -243,13 +243,15 @@ class ArvadosFileWriterTestCase(unittest.TestCase):
     def test_large_write(self):
         keep = ArvadosFileWriterTestCase.MockKeep({})
         api = ArvadosFileWriterTestCase.MockApi({"name":"test_write_large",
-                                                 "manifest_text": ". 48dd23ea1645fd47d789804d71b5bb8e+67108864 b373ad0ffebb84efb524947b247ea89a+32891136 0:100000000:count.txt\n"},
+                                                 "manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 48dd23ea1645fd47d789804d71b5bb8e+67108864 77c57dc6ac5a10bb2205caaa73187994+32891126 0:100000000:count.txt\n"},
                                                 {"uuid":"zzzzz-4zz18-mockcollection0",
-                                                 "manifest_text": ". 48dd23ea1645fd47d789804d71b5bb8e+67108864 598cc1a4ccaef8ab6e4724d87e675d78+32891136 0:100000000:count.txt\n"})
+                                                 "manifest_text": ". 781e5e245d69b566979b86e28d23f2c7+10 48dd23ea1645fd47d789804d71b5bb8e+67108864 77c57dc6ac5a10bb2205caaa73187994+32891126 0:100000000:count.txt\n"})
         with Collection('. ' + arvados.config.EMPTY_BLOCK_LOCATOR + ' 0:0:count.txt',
                              api_client=api, keep_client=keep) as c:
             writer = c.open("count.txt", "r+")
-            text = "0123456789" * 10000000
+            text = "0123456789"
+            writer.write(text)
+            text = "0123456789" * 9999999
             writer.write(text)
             self.assertEqual(writer.size(), 100000000)
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list