Skip to content

Commit

Permalink
ensure all the figures are copied over
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed Mar 19, 2020
1 parent 2eeb8cc commit eb1c4bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions niworkflows/reports/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import matplotlib.pyplot as plt
from bids.layout.writing import build_path
from bids.layout import BIDSLayout

import pytest

Expand Down Expand Up @@ -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

0 comments on commit eb1c4bd

Please sign in to comment.