-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add message delete event #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #524 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 126 127 +1
Lines 4417 4453 +36
=========================================
+ Hits 4417 4453 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f3e44b3 to
ffaa002
Compare
| # - Arrange - | ||
| payload = { | ||
| "sync_id": "a465f0f3-1354-491c-8f11-f400164295cb", | ||
| "command": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предлагаю сделать фабрики пэйлоада через FactoryBoy
Вот тут(в BotAPIJoinToChatFactory) я делал для моего кейса, но они все отличаются по сути только(command__data), можно попробовать обобщить.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поставил, но она странно отрабатывает, на /command все значения приходят внутри массива, а не как ожидается, пришлось передавать аргументы в фабрику явно, кроме того случая когда мы ожидаем список как с sync_ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
потом можно делать вот так
event_deleted_data = DeleteEventFactory.create()
.....
diff = DeepDiff(
event_deleted,
EventDeleted(
bot=BotAccount(id=bot_id, host=host),
raw_command=None,
deleted_at=datetime_formatter(event_deleted_data["deleted_at"]),
meta=event_deleted_data["meta"],
group_chat_id=UUID(event_deleted_data["group_chat_id"]),
sync_ids=[UUID(uuid_str)for uuid_str in event_deleted_data["sync_ids"]],
),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправил. Спасибо :)
ffaa002 to
669b2ca
Compare
669b2ca to
918d616
Compare
osovskiyalexandr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kutuzov13 @vladimirgubarik хорошая работа!

PR checklist
pyproject.tomlpybotxinbot-template