mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Improving test_shipping_query
This commit is contained in:
parent
83730276bc
commit
c5e0742337
1 changed files with 10 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from aiogram.api.methods import AnswerShippingQuery
|
||||
from aiogram.api.types import ShippingAddress, ShippingQuery, User
|
||||
from aiogram.api.types import ShippingAddress, ShippingQuery, User, ShippingOption, LabeledPrice
|
||||
|
||||
|
||||
class TestInlineQuery:
|
||||
|
|
@ -18,7 +18,14 @@ class TestInlineQuery:
|
|||
),
|
||||
)
|
||||
|
||||
api_method = shipping_query.answer(True)
|
||||
shipping_options = [
|
||||
ShippingOption(id="id", title="foo", prices=[LabeledPrice(label="foo", amount=123)])]
|
||||
|
||||
kwargs = dict(ok=True, shipping_options=shipping_options, error_message="foo")
|
||||
|
||||
api_method = shipping_query.answer(**kwargs)
|
||||
|
||||
assert isinstance(api_method, AnswerShippingQuery)
|
||||
assert api_method.shipping_query_id == shipping_query.id
|
||||
|
||||
for key, value in kwargs.items():
|
||||
assert getattr(api_method, key) == value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue