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'))
def test_extract_tags_with_no_text_raises_400(test_app): resp = test_app.post('/extract/', expect_errors=True) assert resp.status_code == 400