19686: Fix test scaffolding after API changes
authorBrett Smith <brett.smith@curii.com>
Wed, 7 Dec 2022 20:21:43 +0000 (15:21 -0500)
committerBrett Smith <brett.smith@curii.com>
Thu, 8 Dec 2022 16:05:48 +0000 (11:05 -0500)
Without clearing arv-put's API client this way, multiple calls to main()
reuse the same, pre-patch Keep object from ThreadSafeApiCache, so calls
don't get recorded as intended.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

sdk/python/tests/test_arv_put.py

index 0e531dee314529534aa4b5ae14815756105f0e66..afdf2238a71caf8fb212d19527ceab79c27f8b96 100644 (file)
@@ -813,6 +813,7 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers,
 
     def test_put_block_replication(self):
         self.call_main_on_test_file()
+        arv_put.api_client = None
         with mock.patch('arvados.collection.KeepClient.local_store_put') as put_mock:
             put_mock.return_value = 'acbd18db4cc2f85cedef654fccc4a4d8+3'
             self.call_main_on_test_file(['--replication', '1'])