mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-14 10:53:23 +00:00
Update deprecated pydantic fields access (#1309)
* chore: update deprecated pydantic fields access * chore: add type hints for test * fix: 3.9- type support
This commit is contained in:
parent
490381b57f
commit
8a77939d5b
1 changed files with 4 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from typing import Dict
|
||||
|
||||
import pytest
|
||||
|
||||
from aiogram.types import ReplyKeyboardRemove
|
||||
|
|
@ -10,12 +12,12 @@ class TestReplyKeyboardRemove:
|
|||
|
||||
def test_remove_keyboard_default_is_true(self):
|
||||
assert (
|
||||
ReplyKeyboardRemove.__fields__["remove_keyboard"].default is True
|
||||
ReplyKeyboardRemove.model_fields["remove_keyboard"].default is True
|
||||
), "Remove keyboard has incorrect default value!"
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"kwargs,expected",
|
||||
[[{}, True], [{"remove_keyboard": True}, True]],
|
||||
)
|
||||
def test_remove_keyboard_values(self, kwargs, expected):
|
||||
def test_remove_keyboard_values(self, kwargs: Dict[str, bool], expected: bool):
|
||||
assert ReplyKeyboardRemove(**kwargs).remove_keyboard is expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue