mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed coverage
This commit is contained in:
parent
e30e89a789
commit
222d48ea09
2 changed files with 6 additions and 20 deletions
|
|
@ -78,27 +78,21 @@ class TestKeyboardBuilder:
|
|||
row=[KeyboardButton(text=f"test {index}") for index in range(count)]
|
||||
)
|
||||
|
||||
def test_validate_markup(self):
|
||||
def test_validate_markup_invalid_type(self):
|
||||
builder = ReplyKeyboardBuilder()
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
builder._validate_markup(markup=())
|
||||
|
||||
def test_validate_markup_too_many_buttons(self):
|
||||
builder = ReplyKeyboardBuilder()
|
||||
with pytest.raises(ValueError):
|
||||
builder._validate_markup(
|
||||
markup=[
|
||||
[KeyboardButton(text=f"{row}.{col}") for col in range(builder.max_width + 5)]
|
||||
for row in range(5)
|
||||
[KeyboardButton(text=f"{row}.{col}") for col in range(builder.max_width)]
|
||||
for row in range(builder.max_buttons)
|
||||
]
|
||||
)
|
||||
|
||||
assert builder._validate_markup(
|
||||
markup=[
|
||||
[KeyboardButton(text=f"{row}.{col}") for col in range(builder.max_width)]
|
||||
for row in range(5)
|
||||
]
|
||||
)
|
||||
|
||||
def test_validate_size(self):
|
||||
builder = ReplyKeyboardBuilder()
|
||||
with pytest.raises(ValueError):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue