Skip to content

Conversation

@kutuzov13
Copy link
Member

PR checklist

  • I've written good commit message for all commits
  • I've split changes into separate commits where it's appropriate
  • I've added the description of function to documentation
  • I've updated project version in pyproject.toml
  • I'll make a release when PR is merged
  • I'll bump pybotx in bot-template

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8b7ebd6) to head (918d616).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kutuzov13 kutuzov13 force-pushed the feature/event-delete branch 4 times, most recently from f3e44b3 to ffaa002 Compare September 23, 2025 16:01
# - Arrange -
payload = {
"sync_id": "a465f0f3-1354-491c-8f11-f400164295cb",
"command": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю сделать фабрики пэйлоада через FactoryBoy
Вот тут(в BotAPIJoinToChatFactory) я делал для моего кейса, но они все отличаются по сути только(command__data), можно попробовать обобщить.

Copy link
Member Author

@kutuzov13 kutuzov13 Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поставил, но она странно отрабатывает, на /command все значения приходят внутри массива, а не как ожидается, пришлось передавать аргументы в фабрику явно, кроме того случая когда мы ожидаем список как с sync_ids

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это потому что ты в фабрике запятую не заметил=)
image

Copy link
Contributor

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"]],
        ),
    )


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил. Спасибо :)

Copy link
Contributor

@osovskiyalexandr osovskiyalexandr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kutuzov13 @vladimirgubarik хорошая работа!

@kutuzov13 kutuzov13 merged commit 004bfb7 into master Sep 24, 2025
9 checks passed
@kutuzov13 kutuzov13 deleted the feature/event-delete branch September 24, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants