3 # ARVADOS_API_TOKEN=abc ARVADOS_API_HOST=arvados.local python -m unittest discover
10 class PipelineTemplateTest(unittest.TestCase):
15 run_test_server.authorize_with("admin")
16 pt_uuid = arvados.api('v1', cache=False).pipeline_templates().create(
17 body={'name':__file__}
19 self.assertEqual(len(pt_uuid), 27,
20 'Unexpected format of pipeline template UUID ("%s")'
24 '-x-': [1,2,{'foo':'bar'}],
25 'Boggis': {'Bunce': '[\'Bean\']'},
28 'spass-box': [True, 'Maybe', False]
30 update_response = arvados.api('v1', cache=False).pipeline_templates().update(
32 body={'components':components}
34 self.assertEqual('uuid' in update_response, True,
35 'update() response did not include a uuid')
36 self.assertEqual(update_response['uuid'], pt_uuid,
37 'update() response has a different uuid (%s, not %s)'
38 % (update_response['uuid'], pt_uuid))
39 self.assertEqual(update_response['name'], __file__,
40 'update() response has a different name (%s, not %s)'
41 % (update_response['name'], __file__))
42 get_response = arvados.api('v1', cache=False).pipeline_templates().get(
45 self.assertEqual(get_response['components'], components,
46 'components got munged by server (%s -> %s)'
47 % (components, update_response['components']))
48 delete_response = arvados.api('v1', cache=False).pipeline_templates().delete(
51 self.assertEqual(delete_response['uuid'], pt_uuid,
52 'delete() response has wrong uuid (%s, not %s)'
53 % (delete_response['uuid'], pt_uuid))
54 with self.assertRaises(apiclient.errors.HttpError):
55 geterror_response = arvados.api('v1', cache=False).pipeline_templates().get(
60 run_test_server.stop()