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()
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', } }
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, }