Esempio n. 1
0
def test_find_acquisition_project():
    project = MockParent('project')
    expected_value = [
        {
            '_id': 'acquisition_id',
            'type': 'acquisition'
        }
    ]
    actual_value = run.find_error_containers('acquisition', project)
    assert expected_value == actual_value
Esempio n. 2
0
def test_find_session_project():
    project = MockParent('project')
    expected_value = [
        {
            '_id': 'session_id',
            'type': 'session'
        }
    ]

    assert expected_value == run.find_error_containers('session', project)
Esempio n. 3
0
def test_find_acquisition_session():
    session = MockParent('session')
    expected_value = [
        {
            '_id': 'acquisition_id',
            'type': 'acquisition'
        }
    ]

    assert expected_value == run.find_error_containers('acquisition', session)
Esempio n. 4
0
def test_find_acquisition_subject():
    subject = MockParent('subject')
    expected_value = [
        {
            '_id': 'acquisition_id',
            'type': 'acquisition'
        }
    ]

    assert expected_value == run.find_error_containers('acquisition', subject)
Esempio n. 5
0
def test_find_all_for_project():
    project = MockParent('project')
    expected_value = [
        {
            '_id': 'subject_id',
            'type': 'subject'
        },
        {
            '_id': 'session_id',
            'type': 'session'
        },
        {
            '_id': 'acquisition_id',
            'type': 'acquisition'
        }
    ]

    assert expected_value == run.find_error_containers('all', project)
Esempio n. 6
0
def test_find_subject_subject():
    subject = MockParent('subject')
    with pytest.raises(ValueError):
        run.find_error_containers('subject', subject)
Esempio n. 7
0
def test_find_session_session():
    session = MockParent('session')
    with pytest.raises(ValueError):
        run.find_error_containers('session', session)