[ARVADOS] updated: 094b60e60cc4e3b20a015daecda8bcafdc3bdb43

git at public.curoverse.com git at public.curoverse.com
Wed Oct 7 10:54:56 EDT 2015


Summary of changes:
 sdk/python/tests/test_arv_put.py | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

       via  094b60e60cc4e3b20a015daecda8bcafdc3bdb43 (commit)
      from  ccdb53bf1ea5067edbbbbe71ecb89425bafa86b1 (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 094b60e60cc4e3b20a015daecda8bcafdc3bdb43
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Oct 7 10:47:23 2015 -0400

    7254: Test arv-put preserves replication when cache load fails.

diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index debbd54..896b880 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -383,19 +383,15 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers, ArvadosBaseTestCase):
             os.chmod(cachedir, 0o700)
 
     def test_put_block_replication(self):
-        with mock.patch('arvados.collection.KeepClient.local_store_put') as put_mock:
+        with mock.patch('arvados.collection.KeepClient.local_store_put') as put_mock, \
+             mock.patch('arvados.commands.put.ResumeCache.load') as cache_mock:
+            cache_mock.side_effect = ValueError
             put_mock.return_value = 'acbd18db4cc2f85cedef654fccc4a4d8+3'
-            orig_cachedir = arv_put.ResumeCache.CACHE_DIR
-            cachedir = self.make_tmpdir()
-            arv_put.ResumeCache.CACHE_DIR = os.path.join(cachedir, 'cachedir')
-            try:
-                self.call_main_on_test_file(['--replication', '1'])
-                self.call_main_on_test_file(['--replication', '4'])
-                self.call_main_on_test_file(['--replication', '5'])
-            finally:
-                arv_put.ResumeCache.CACHE_DIR = orig_cachedir
+            self.call_main_on_test_file(['--replication', '1'])
+            self.call_main_on_test_file(['--replication', '4'])
+            self.call_main_on_test_file(['--replication', '5'])
             self.assertEqual(
-                [x[len(x)-1].get('copies') for x in put_mock.call_args_list],
+                [x[-1].get('copies') for x in put_mock.call_args_list],
                 [1, 4, 5])
 
     def test_normalize(self):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list