Пример #1
0
def test_extract_tags(test_app):
    text = 'we used slice timing correction in SPM 8'
    resp = test_app.post(
        '/extract/',
        params=json.dumps({'text': text}),
        headers={'Content-Type': 'application/json'},
    )
    tags = resp.json['tags']
    assert len(tags) == 2
    assert set([tag['label'] for tag in tags]) == set(('stc', 'spm'))
Пример #2
0
def test_extract_tags(test_app):
    text = 'we used slice timing correction in SPM 8'
    resp = test_app.post(
        '/extract/',
        params=json.dumps({'text': text}),
        headers={'Content-Type': 'application/json'},
    )
    tags = resp.json['tags']
    assert len(tags) == 2
    assert set([tag['label'] for tag in tags]) == set(('stc', 'spm'))
Пример #3
0
def test_extract_tags_with_no_text_raises_400(test_app):
    resp = test_app.post('/extract/', expect_errors=True)
    assert resp.status_code == 400
Пример #4
0
def test_extract_tags_with_no_text_raises_400(test_app):
    resp = test_app.post('/extract/', expect_errors=True)
    assert resp.status_code == 400