2022-01-21 19:37:11 +00:00
|
|
|
from tests.base_test import BaseTest
|
|
|
|
|
2022-01-24 15:35:11 +00:00
|
|
|
import json
|
2022-01-21 19:37:11 +00:00
|
|
|
|
|
|
|
|
2022-01-24 15:35:11 +00:00
|
|
|
class TestMissingLibrary(BaseTest):
|
2022-01-21 19:37:11 +00:00
|
|
|
|
2022-01-24 15:35:11 +00:00
|
|
|
def test_missing_library(self):
|
2022-01-24 16:06:01 +00:00
|
|
|
"""This workflow calls a library that does not exist,
|
|
|
|
we validate the workflow, and assert that our error service hint is in the error message."""
|
2022-01-24 15:35:11 +00:00
|
|
|
workflow = self.create_workflow('missing_library')
|
2022-01-24 16:03:49 +00:00
|
|
|
rv = self.app.get('/v1.0/workflow-specification/%s/validate' % workflow.workflow_spec_id, headers=self.logged_in_headers())
|
2022-01-24 15:35:11 +00:00
|
|
|
json_data = json.loads(rv.get_data(as_text=True))
|
2022-01-24 16:03:49 +00:00
|
|
|
self.assertEqual('workflow_validation_error', json_data[0]['code'])
|
|
|
|
self.assertIn("'Process_Multiply' was not found", json_data[0]['message'])
|
|
|
|
self.assertEqual('The workflow spec could not be parsed. If you are loading a library, check whether the name is correct.', json_data[0]['hint'])
|