mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-13 18:43:53 +00:00
Added full support of Bot API 7.5 (#1518)
* Added full support of Bot API 7.5 * Added changelog * Update date type in RevenueWithdrawalStateSucceeded * Added example
This commit is contained in:
parent
dcfc9632f3
commit
1f7bbeb355
72 changed files with 1629 additions and 51 deletions
46
tests/test_api/test_methods/test_get_star_transactions.py
Normal file
46
tests/test_api/test_methods/test_get_star_transactions.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from datetime import datetime
|
||||
|
||||
from aiogram.methods import GetStarTransactions
|
||||
from aiogram.types import (
|
||||
File,
|
||||
StarTransaction,
|
||||
StarTransactions,
|
||||
TransactionPartnerUser,
|
||||
User,
|
||||
)
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestGetStarTransactions:
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
user = User(id=42, is_bot=False, first_name="Test")
|
||||
prepare_result = bot.add_result_for(
|
||||
GetStarTransactions,
|
||||
ok=True,
|
||||
result=StarTransactions(
|
||||
transactions=[
|
||||
StarTransaction(
|
||||
id="test1",
|
||||
user=user,
|
||||
amount=1,
|
||||
date=datetime.now(),
|
||||
source=TransactionPartnerUser(
|
||||
user=user,
|
||||
),
|
||||
),
|
||||
StarTransaction(
|
||||
id="test2",
|
||||
user=user,
|
||||
amount=1,
|
||||
date=datetime.now(),
|
||||
receiver=TransactionPartnerUser(
|
||||
user=user,
|
||||
),
|
||||
),
|
||||
]
|
||||
),
|
||||
)
|
||||
|
||||
response: File = await bot.get_star_transactions(limit=10, offset=0)
|
||||
request = bot.get_request()
|
||||
assert response == prepare_result.result
|
||||
Loading…
Add table
Add a link
Reference in a new issue