Merge remote-tracking branch 'origin/feature/spec_files_wthout_db' into feature/spec_files_wthout_db

This commit is contained in:
alicia pritchett 2022-02-09 13:41:53 -05:00
commit c830c468b6
3 changed files with 3 additions and 4 deletions

View File

@ -109,6 +109,8 @@ class WorkflowProcessor(object):
if workflow_model.bpmn_workflow_json is None:
self.workflow_spec_service.scan_file_system()
spec_info = self.workflow_spec_service.get_spec(workflow_model.workflow_spec_id)
if spec_info is None:
raise (ApiError("missing_spec", "The spec this workflow references does not currently exist."))
self.spec_files = SpecFileService.get_files(spec_info, include_libraries=True)
spec = self.get_spec(self.spec_files, spec_info)

View File

@ -307,6 +307,7 @@ class BaseTest(unittest.TestCase):
def create_workflow(self, dir_name, display_name=None, study=None, category_id=None, as_user="dhf8r"):
session.flush()
self.workflow_spec_service.scan_file_system()
spec = self.workflow_spec_service.get_spec(dir_name)
if spec is None:
if display_name is None:

View File

@ -7,8 +7,6 @@ import datetime
class TestGetLocaltime(BaseTest):
def test_get_localtime(self):
self.load_example_data()
timestamp = datetime.datetime.utcnow()
workflow = self.create_workflow('get_localtime')
@ -28,7 +26,6 @@ class TestGetLocaltime(BaseTest):
self.assertEqual(dateparser.parse(localtime_without), GetLocaltime().do_task(None, None, None, str(timestamp)))
def test_get_localtime_with_timezone(self):
self.load_example_data()
timestamp = datetime.datetime.utcnow()
workflow = self.create_workflow('get_localtime')
@ -51,7 +48,6 @@ class TestGetLocaltime(BaseTest):
def test_get_localtime_no_timestamp(self):
workflow = self.create_workflow('get_localtime')
workflow_api = self.get_workflow_api(workflow)
task = workflow_api.next_task