From 69902ee6583e1de32786e80b77c8f61870ed6f90 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 27 Jul 2016 09:44:18 -0300 Subject: [PATCH] 9463: Parameter naming unification on _BlockManager. Corrected mocked discovery doc on test. --- sdk/python/arvados/arvfile.py | 10 +++++----- sdk/python/tests/test_arvfile.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py index 90db6ce51b..f2f7df2dce 100644 --- a/sdk/python/arvados/arvfile.py +++ b/sdk/python/arvados/arvfile.py @@ -414,7 +414,7 @@ class _BlockManager(object): self.prefetch_enabled = True self.num_put_threads = _BlockManager.DEFAULT_PUT_THREADS self.num_get_threads = _BlockManager.DEFAULT_GET_THREADS - self.num_put_copies = copies + self.copies = copies @synchronized def alloc_bufferblock(self, blockid=None, starting_capacity=2**14, owner=None): @@ -465,10 +465,10 @@ class _BlockManager(object): if bufferblock is None: return - if self.num_put_copies is None: + if self.copies is None: loc = self._keep.put(bufferblock.buffer_view[0:bufferblock.write_pointer].tobytes()) else: - loc = self._keep.put(bufferblock.buffer_view[0:bufferblock.write_pointer].tobytes(), copies=self.num_put_copies) + loc = self._keep.put(bufferblock.buffer_view[0:bufferblock.write_pointer].tobytes(), copies=self.copies) bufferblock.set_state(_BufferBlock.COMMITTED, loc) except Exception as e: @@ -581,10 +581,10 @@ class _BlockManager(object): if sync: try: - if self.num_put_copies is None: + if self.copies is None: loc = self._keep.put(block.buffer_view[0:block.write_pointer].tobytes()) else: - loc = self._keep.put(block.buffer_view[0:block.write_pointer].tobytes(), copies=self.num_put_copies) + loc = self._keep.put(block.buffer_view[0:block.write_pointer].tobytes(), copies=self.copies) block.set_state(_BufferBlock.COMMITTED, loc) except Exception as e: block.set_state(_BufferBlock.ERROR, e) diff --git a/sdk/python/tests/test_arvfile.py b/sdk/python/tests/test_arvfile.py index da8bf684e8..2e43216da8 100644 --- a/sdk/python/tests/test_arvfile.py +++ b/sdk/python/tests/test_arvfile.py @@ -40,7 +40,7 @@ class ArvadosFileWriterTestCase(unittest.TestCase): self._schema = ArvadosFileWriterTestCase.MockApi.MockSchema() class MockSchema(object): def __init__(self): - self.schemas = {'Collection': {'properties': {'replication_desired': 2}}} + self.schemas = {'Collection': {'properties': {'replication_desired': {'type':'integer'}}}} class MockCollections(object): def __init__(self, b, r): self.body = b -- 2.30.2