diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index f2af91aa26a..d3277abfbda 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1022,8 +1022,9 @@ class Tool(Dictifiable): has_missing_data = len(edam_operations) == 0 or len(edam_topics) == 0 if has_missing_data: biotools_reference = self.biotools_reference - if biotools_reference: - biotools_entry = self.app.biotools_metadata_source.get_biotools_metadata(biotools_reference) + metadata_source = self.app.biotools_metadata_source + if biotools_reference and metadata_source: + biotools_entry = metadata_source.get_biotools_metadata(biotools_reference) if biotools_entry: edam_info = biotools_entry.edam_info if len(edam_operations) == 0: diff --git a/test/unit/unittest_utils/galaxy_mock.py b/test/unit/unittest_utils/galaxy_mock.py index 2e50ed279f5..381bbb57c7a 100644 --- a/test/unit/unittest_utils/galaxy_mock.py +++ b/test/unit/unittest_utils/galaxy_mock.py @@ -103,6 +103,7 @@ class MockApp(di.Container): self.user_manager = UserManager(self) self.execution_timer_factory = Bunch(get_timer=StructuredExecutionTimer) self.is_job_handler = False + self.biotools_metadata_source = None rebind_container_to_task(self) def url_for(*args, **kwds):