def METHOD_NAME(tmp_path, test_id, json_layout, n_files, n_subjects, n_sessions):
    root = tmp_path / test_id
    generate_bids_skeleton(root, json_layout)
    datadesc = root / "dataset_description.json"
    assert datadesc.exists()
    assert "BIDSVersion" in datadesc.read_text()
    assert len([x for x in root.glob("**/*") if x.is_file()]) == n_files
    # ensure layout is valid
    layout = BIDSLayout(root)
    assert len(layout.get_subjects()) == n_subjects
    assert len(layout.get_sessions()) == n_sessions
    anat = layout.get(suffix="T1w", extension="nii.gz")[0]
    bold = layout.get(suffix="bold", extension="nii.gz")[0]
    assert anat.get_metadata()
    assert bold.get_metadata()