Skip to content

получение преподавателя по id - #9

Open
rifcrat wants to merge 3 commits into
mainfrom
getting_lecturer_by_id
Open

получение преподавателя по id#9
rifcrat wants to merge 3 commits into
mainfrom
getting_lecturer_by_id

Conversation

@rifcrat

@rifcrat rifcrat commented Jul 25, 2025

Copy link
Copy Markdown

Написал тест, в котором проверяются get запросы на получение преподавателя по id

Comment thread tests/rating/getting_lecturer_by_id.py Outdated
load_dotenv()
URL = os.getenv("URL")

lect_id = 7000

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему 7000?

Comment thread tests/rating/getting_lecturer_by_id.py Outdated
Comment on lines +14 to +19
"id": int,
"first_name": str,
"last_name": str,
"middle_name": str,
"avatar_link": str,
"timetable_id": int,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ты это запускал? оно не сработает

Comment thread tests/rating/getting_lecturer_by_id.py Outdated
assert isinstance(lecturer[field], expected_type)


incorrect_id = 99999

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему 99999 некорректный?

Comment thread tests/rating/getting_lecturer_by_id.py Outdated
Comment on lines +17 to +19
incorrect_1 = 0
incorrect_2 = -1
def test_incorrect_id():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

примени тут parametrize, он сам подставит

вот так:

@pytest.mark.parametrize("incorrect_id", [0, -1, -9999])
def test_incorrect_id(incorrect_id): # <----  он сюда сам прокинется

Comment thread tests/rating/getting_lecturer_by_id.py Outdated
Comment on lines +26 to +27
invalid_format_id = "evw"
def test_invalid_format_id():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут аналогично

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants