[ARVADOS] updated: a8ed46722860019c0d69f89497a33a7d22d36074
git at public.curoverse.com
git at public.curoverse.com
Thu Aug 20 14:04:42 EDT 2015
Summary of changes:
sdk/python/tests/test_init.py | 51 +++++++------------------------------------
1 file changed, 8 insertions(+), 43 deletions(-)
via a8ed46722860019c0d69f89497a33a7d22d36074 (commit)
from 39f461e6b1a1cecdcc3bea2d6af0bece2162ef88 (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 a8ed46722860019c0d69f89497a33a7d22d36074
Author: Bryan Cosca <bcosc at curoverse.com>
Date: Thu Aug 20 14:02:23 2015 -0400
flailing disregard commit
diff --git a/sdk/python/tests/test_init.py b/sdk/python/tests/test_init.py
index b180e1c..40de3a9 100644
--- a/sdk/python/tests/test_init.py
+++ b/sdk/python/tests/test_init.py
@@ -8,51 +8,16 @@ import arvados
import arvados.collection
import arvados_testutil as tutil
import run_test_server
+from arvados_testutil import FakeCurl
+from arvados_testutil import queue_with
+from arvados_testutil import mock_responses
-class CollectionTestMixin(tutil.ApiClientMock):
- API_COLLECTIONS = run_test_server.fixture('collections')
- DEFAULT_COLLECTION = API_COLLECTIONS['foo_file']
- DEFAULT_DATA_HASH = DEFAULT_COLLECTION['portable_data_hash']
- DEFAULT_MANIFEST = DEFAULT_COLLECTION['manifest_text']
- DEFAULT_UUID = DEFAULT_COLLECTION['uuid']
- ALT_COLLECTION = API_COLLECTIONS['bar_file']
- ALT_DATA_HASH = ALT_COLLECTION['portable_data_hash']
- ALT_MANIFEST = ALT_COLLECTION['manifest_text']
+class JobSetupTestCase(unittest.TestCase):
- def api_client_mock(self, status=200):
- client = super(CollectionTestMixin, self).api_client_mock()
- self.mock_keep_services(client, status=status, service_type='proxy', count=1)
- return client
-
-class JobSetupTestCase(unittest.TestCase, CollectionTestMixin):
- def mock_get_collection(self, api_mock, code, body):
- body = self.API_COLLECTIONS.get(body)
- self._mock_api_call(api_mock.collections().get, code, body)
-
- def api_client_mock(self, status=200):
- client = super(SDKTestCase, self).api_client_mock()
- self.mock_get_collection(client, status, 'foo_file')
- return client
-
- def test_one_task_per_input_file_no_default_retries(self):
- client = self.api_client_mock(200)
- test = arvados.job_setup.one_task_per_input_file(api_client=client,num_retries=0)
- client.job_tasks().update().execute.assert_called_with(num_retries=0)
-
-class SDKTestCase(unittest.TestCase, CollectionTestMixin):
- def mock_get_collection(self, api_mock, code, body):
- body = self.API_COLLECTIONS.get(body)
- self._mock_api_call(api_mock.collections().get, code, body)
-
- def api_client_mock(self, status=200):
- client = super(SDKTestCase, self).api_client_mock()
- self.mock_get_collection(client, status, 'foo_file')
- return client
-
- def test_init_no_default_retries(self):
- client = self.api_client_mock(200)
- test = arvados.task_set_output({'uuid':'zzzzz-zzzzz-zzzzzzzzzzzzzzz'}, s=self.DEFAULT_DATA_HASH, api_client=client)
- #client.job_tasks().update().execute.assert_called_with(num_retries=0)
+ def test_task_output_success(self):
+ mock_api=mock.MagicMock()
+ with mock_responses({}, 500,200,300, header=None):
+ arvados.job_setup.one_task_per_input_file(api_client=mock_api,num_retries=0)
#### tests for functions, not methods ####
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list