Пример #1
0
def test_extract_small_dataset_default_n():
    __output_dir__ = os.path.join(__tmp_dir__, 'output_extract_small_dataset')
    extract_small_dataset.main(
        args=['--input', __data_testing_dir__, '--output', __output_dir__])
    assert os.path.exists(__output_dir__)
    output_dir_list = os.listdir(__output_dir__)
    assert 'derivatives' in output_dir_list
    assert 'participants.tsv' in output_dir_list
    assert 'dataset_description.json' in output_dir_list
    assert 'sub-unf01' in output_dir_list or \
        'sub-unf02' in output_dir_list or \
        'sub-unf03' in output_dir_list
def test_extract_small_dataset_contrast_list(download_functional_test_files):
    __output_dir__ = Path(__tmp_dir__, 'output_extract_small_dataset_4')
    extract_small_dataset.main(args=[
        '--input',
        str(__data_testing_dir__), '--output',
        str(__output_dir__), '-c', 'T1w, T2w'
    ])
    assert __output_dir__.exists()
    output_dir_list = [f.name for f in __output_dir__.iterdir()]
    assert 'derivatives' in output_dir_list
    assert 'participants.tsv' in output_dir_list
    assert 'dataset_description.json' in output_dir_list
    assert 'sub-unf01' in output_dir_list or \
        'sub-unf02' in output_dir_list or \
        'sub-unf03' in output_dir_list