improve data model tests

This commit is contained in:
Sina Atalay 2024-01-26 19:48:08 +01:00
parent 4f88245e5f
commit 1d1d45f39d
1 changed files with 171 additions and 0 deletions

View File

@ -10,11 +10,182 @@ def dummy_input():
"sections": None, "sections": None,
} }
# abi burda baya bi senaryo test etmen lazim: # abi burda baya bi senaryo test etmen lazim:
# mesela section icinde title field verilmisse, title o olamli, herseyo overwrite etmeli # mesela section icinde title field verilmisse, title o olamli, herseyo overwrite etmeli
# sonra siralama listede verildigi gibi olmali kesinlikle bunu da check et # sonra siralama listede verildigi gibi olmali kesinlikle bunu da check et
# sonra default listler alisiyo mu kesinlikle onu check etmek lazim # sonra default listler alisiyo mu kesinlikle onu check etmek lazim
# bide validation errorleri check etmek lazim # bide validation errorleri check etmek lazim
# REPLACEWITHTODAY olayini monkeypatch ile duzelticeksin, hep statik bir tarih return etsin
def test_sections(dummy_input):
dummy_input["sections"] = {
"My Section 1": {
"entry_type": "EducationEntry",
"entries": [
{
"institution": "Boğaziçi University",
"area": "Mechanical Engineering",
}
],
},
"My Section 2": {
"entry_type": "ExperienceEntry",
"entries": [
{
"company": "Apple",
"position": "Researcher",
}
],
},
"My Section 3": {
"entry_type": "PublicationEntry",
"entries": [
{
"title": "My Title",
"authors": ["John Doe", "Jane Doe"],
"doi": "10.1109/TASC.2023.3340648",
"date": "2023-12-08",
}
],
},
"my_section_4": {
"entry_type": "NormalEntry",
"entries": [
{
"name": "My Entry",
}
],
},
"my_section_5": {
"entry_type": "OneLineEntry",
"entries": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
},
"my_section_6": {
"entry_type": "TextEntry",
"entries": ["My Text Entry"],
},
"Education": [
{
"institution": "Boğaziçi University",
"area": "Mechanical Engineering",
}
],
"Experience": [
{
"company": "Apple",
"position": "Researcher",
}
],
"Work Experience": [
{
"company": "Apple",
"position": "Researcher",
}
],
"Research Experience": [
{
"company": "Apple",
"position": "Researcher",
}
],
"Publications": [
{
"title": "My Title",
"authors": ["John Doe", "Jane Doe"],
"doi": "10.1109/TASC.2023.3340648",
"date": "2023-12-08",
}
],
"Papers": [
{
"title": "My Title",
"authors": ["John Doe", "Jane Doe"],
"doi": "10.1109/TASC.2023.3340648",
"date": "2023-12-08",
}
],
"Projects": [
{
"name": "My Entry",
}
],
"Academic Projects": [
{
"name": "My Entry",
}
],
"University Projects": [
{
"name": "My Entry",
}
],
"Personal Projects": [
{
"name": "My Entry",
}
],
"Certificates": [
{
"name": "My Entry",
}
],
"Extracurricular Activities": [
{
"company": "Apple",
"position": "Researcher",
}
],
"Test Scores": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
"Skills": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
"Programming Skills": [
{
"name": "My Entry",
}
],
"Other Skills": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
"Awards": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
"Interests": [
{
"name": "My One Line Entry",
"details": "My Details",
}
],
"Summary": ["My Text Entry"],
}
cv = dm.CurriculumVitae(**dummy_input)
assert len(cv.sections) == 22
titles = [section.title for section in cv.sections]
for key in dummy_input["sections"]:
assert key in titles
def test_education_entry(dummy_input): def test_education_entry(dummy_input):