Skip to content

Commit

Permalink
FIX: Resolve side-effects of new testfile in #682
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Jan 12, 2021
1 parent 7d9c27c commit 412c3b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 10 additions & 0 deletions bids/layout/tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import re
from os.path import join, abspath, basename
from pathlib import Path
import shutil
import json

import numpy as np
import pytest
Expand Down Expand Up @@ -51,6 +53,14 @@ def test_layout_repr(layout_7t_trt):
assert "Subjects: 10 | Sessions: 20 | Runs: 20" in str(layout_7t_trt)


def test_layout_repr_overshadow_run(tmp_path):
"""A test creating a layout to replicate #681."""
shutil.copytree(join(get_test_data_path(), '7t_trt'), tmp_path / "7t_trt")
(tmp_path / "7t_trt" / "sub-01" / "ses-1" / "sub-01_ses-1_scans.json").write_text(
json.dumps({"run": {"Description": "metadata to cause #681"}})
)
assert "Subjects: 10 | Sessions: 20 | Runs: 20" in str(BIDSLayout(tmp_path / "7t_trt"))

# def test_layout_copy(layout_7t_trt):
# # Largely a smoke test to guarantee that copy() does not blow
# # see https://github.com/bids-standard/pybids/pull/400#issuecomment-467961124
Expand Down
5 changes: 0 additions & 5 deletions bids/tests/data/7t_trt/sub-01/ses-1/sub-01_ses-1_scans.json

This file was deleted.

0 comments on commit 412c3b2

Please sign in to comment.