From eb1c4bd582df9422f578f277c070d3404395366c Mon Sep 17 00:00:00 2001 From: James Kent Date: Thu, 19 Mar 2020 00:02:37 -0500 Subject: [PATCH] ensure all the figures are copied over --- niworkflows/reports/tests/test_core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/niworkflows/reports/tests/test_core.py b/niworkflows/reports/tests/test_core.py index 3743db09fd4..d4ccdbf241b 100644 --- a/niworkflows/reports/tests/test_core.py +++ b/niworkflows/reports/tests/test_core.py @@ -9,6 +9,7 @@ import matplotlib.pyplot as plt from bids.layout.writing import build_path +from bids.layout import BIDSLayout import pytest @@ -204,9 +205,12 @@ def test_generated_reportlets(bids_sessions, ordering): needed_entities = ['session', 'task', 'ceagent', 'run'] # the last section is the most recently run reportlets_num = len(report.sections[-1].reportlets) + # get the number of figures in the output directory + out_layout = BIDSLayout(out_dir, config='figures', validate=False) + out_figs = len(out_layout.get()) # if ordering does not contain all the relevent entities # then there should be fewer reportlets than expected if all(ent in ordering for ent in needed_entities): - assert reportlets_num == expected_reportlets_num + assert reportlets_num == expected_reportlets_num == out_figs else: - assert reportlets_num < expected_reportlets_num + assert reportlets_num < expected_reportlets_num == out_figs