[ARVADOS] updated: b5a183155ad9a4332cd0f2b2337876876feb70d5

git at public.curoverse.com git at public.curoverse.com
Wed Sep 23 16:49:43 EDT 2015


Summary of changes:
 sdk/python/arvados/__init__.py             |  4 ----
 sdk/python/tests/test_task_output_retry.py | 18 +++++++++++++-----
 2 files changed, 13 insertions(+), 9 deletions(-)

       via  b5a183155ad9a4332cd0f2b2337876876feb70d5 (commit)
      from  f564c0d4009bf687f3d6f5b9a1a93a8a6bed5e70 (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 b5a183155ad9a4332cd0f2b2337876876feb70d5
Author: Bryan Cosca <bcosc at curoverse.com>
Date:   Wed Sep 23 16:49:38 2015 -0400

    6600: flailing, what is mock.patch doing?

diff --git a/sdk/python/arvados/__init__.py b/sdk/python/arvados/__init__.py
index 2c2be31..fbf88b6 100644
--- a/sdk/python/arvados/__init__.py
+++ b/sdk/python/arvados/__init__.py
@@ -43,10 +43,6 @@ def task_set_output(self,s,api_client=None,num_retries=5):
     if not api_client:
         api_client = api('v1')
 
-    print "tso"
-    print api_client.job_tasks().update().execute
-
-
     for tries_left in RetryLoop(num_retries=num_retries, backoff_start=0): # change this to 2 after tests are finished
         try:
             print "we tried"
diff --git a/sdk/python/tests/test_task_output_retry.py b/sdk/python/tests/test_task_output_retry.py
index e0256ac..9b44e3e 100644
--- a/sdk/python/tests/test_task_output_retry.py
+++ b/sdk/python/tests/test_task_output_retry.py
@@ -30,7 +30,7 @@ class ApiClientRetrytestMixin(object):
     def check_exception(self, error_class=None, api_client=None, *args, **kwargs):
         if error_class is None:
             error_class = self.DEFAULT_EXCEPTION
-        print error_class
+        print error_class.failureException
         self.run_method(api_client=api_client)
         self.assertRaises(error_class, self.run_method(api_client=api_client), *args, **kwargs)
 
@@ -40,11 +40,19 @@ class ApiClientRetrytestMixin(object):
 
     def test_immediate_failure(self):
         api_client = mock.MagicMock()
-        with self.TEST_API_PATCHER(api_client.job_tasks().update().execute, self.DEFAULT_EXPECT, 400) as api_client:
-            print api_client.job_tasks().update().execute.side_effect
-            print dir(api_client.job_tasks().update().execute.side_effect)
+#        with self.TEST_API_PATCHER(self.DEFAULT_EXPECT, 400), tutil.skip_sleep, \
+#                            self.assertRaises(arvados.errors.HttpError) as err_check:
+        with tutil.mock_responses(api_client.job_tasks().update().execute, 500) as req_mock:
+            print dir(req_mock)
+            print req_mock
             #api_client.job_tasks().update().execute.side_effect = arvados.errors.HttpError(400, "{}")
-            self.check_exception(api_client=api_client)
+            #self.check_exception(api_client=api_client)
+            #print dir(err_check)
+            self.run_method(api_client=api_client)
+            #print err_check.failureException
+            #self.assertEqual(400, err_check.exception.request_errors())
+            #self.assertRaises(error_class, self.run_method(api_client=api_client), *args, **kwargs)
+        
 
 #    def test_retry_then_success(self):
 #        with self.TEST_API_PATCHER(self.DEFAULT_EXPECT, 500, 200):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list