fix: display all academic degrees

This commit is contained in:
2026-08-27 17:29:16 +03:00
parent cf810f9cad
commit d07711f665
4 changed files with 47 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
from app.services.academic_degrees import academic_degrees
def test_academic_degrees_extracts_all_degree_names_without_surrounding_text():
data = {
"sections": [
{
"title": "Образование",
"year_entries": [
{"text": "2008 — кандидат технических наук, доцент"},
{"text": "2018 — Доктор физико-математических наук"},
],
},
{
"title": "Учёные степени",
"table": {"rows": [{"cells": ["Ph.D.", "Доктор физико-математических наук"]}]},
},
{"title": "Публикации", "items": ["Доктор медицинских наук выступил автором статьи"]},
]
}
assert academic_degrees(data) == [
"кандидат технических наук",
"Доктор физико-математических наук",
"Ph.D.",
]