Skip to content

Commit 349a3fe

Browse files
committed
Allow display tests to pass if noodles promise not yet built
1 parent 9bfacc2 commit 349a3fe

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

fairworkflows/fairworkflow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ def display(self, full_rdf=False):
332332
if full_rdf:
333333
return self.display_full_rdf()
334334
else:
335+
if not hasattr(self, 'noodles_promise'):
336+
raise ValueError('Cannot display workflow as no noodles promise has been constructed.')
335337
import noodles.tutorial
336338
noodles.tutorial.display_workflows(prefix='control', workflow=self.noodles_promise)
337339

tests/test_fairworkflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ def test_draw_with_graphviz_module_and_dependency(self, tmp_path, test_workflow)
283283
def test_display_without_graphviz_module(self, test_workflow):
284284
"""Test display method without graphviz python module installed."""
285285
with pytest.raises(ImportError):
286-
test_workflow.display()
286+
test_workflow.display(full_rdf=True)
287287

288288
def test_display_with_graphviz_module_and_dependency(self, test_workflow):
289289
"""
290290
Test display method with graphviz python module and graphviz software
291291
installed
292292
"""
293-
test_workflow.display()
293+
test_workflow.display(full_rdf=True)
294294

295295
@mock.patch('fairworkflows.rdf_wrapper.NanopubClient.publish')
296296
def test_publish_as_nanopub(self, mock_publish, test_workflow):

0 commit comments

Comments
 (0)