コード例 #1
0
ファイル: rest.py プロジェクト: UB-Mannheim/Annif
def show_project(project_id):
    """return a single project formatted according to Swagger spec"""

    try:
        project = annif.project.get_project(project_id)
    except ValueError:
        return project_not_found_error(project_id)
    return project.dump()
コード例 #2
0
def test_get_project_fi_dump(app):
    with app.app_context():
        project = annif.project.get_project('dummy-fi')
    pdump = project.dump()
    assert pdump == {
        'project_id': 'dummy-fi',
        'name': 'Dummy Finnish',
        'language': 'fi',
        'backend': {
            'backend_id': 'dummy',
        }
    }
コード例 #3
0
def test_get_project_fi_dump(registry):
    project = registry.get_project('dummy-fi')
    pdump = project.dump()
    assert pdump == {
        'project_id': 'dummy-fi',
        'name': 'Dummy Finnish',
        'language': 'fi',
        'backend': {
            'backend_id': 'dummy',
        },
        'is_trained': True,
        'modification_time': None,
    }