1 from __future__ import absolute_import
4 # ARVADOS_API_TOKEN=abc ARVADOS_API_HOST=arvados.local python -m unittest discover
9 from . import run_test_server
11 class PipelineTemplateTest(run_test_server.TestCaseWithServers):
16 run_test_server.authorize_with("admin")
17 pt_uuid = arvados.api('v1').pipeline_templates().create(
18 body={'name':__file__}
20 self.assertEqual(len(pt_uuid), 27,
21 'Unexpected format of pipeline template UUID ("%s")'
25 '-x-': [1,2,{'foo':'bar'}],
26 'Boggis': {'Bunce': '[\'Bean\']'},
29 'spass-box': [True, 'Maybe', False]
31 update_response = arvados.api('v1').pipeline_templates().update(
33 body={'components':components}
35 self.assertEqual('uuid' in update_response, True,
36 'update() response did not include a uuid')
37 self.assertEqual(update_response['uuid'], pt_uuid,
38 'update() response has a different uuid (%s, not %s)'
39 % (update_response['uuid'], pt_uuid))
40 self.assertEqual(update_response['name'], __file__,
41 'update() response has a different name (%s, not %s)'
42 % (update_response['name'], __file__))
43 get_response = arvados.api('v1').pipeline_templates().get(
46 self.assertEqual(get_response['components'], components,
47 'components got munged by server (%s -> %s)'
48 % (components, update_response['components']))
49 delete_response = arvados.api('v1').pipeline_templates().delete(
52 self.assertEqual(delete_response['uuid'], pt_uuid,
53 'delete() response has wrong uuid (%s, not %s)'
54 % (delete_response['uuid'], pt_uuid))
55 with self.assertRaises(apiclient.errors.HttpError):
56 geterror_response = arvados.api('v1').pipeline_templates().get(