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
Add getting user from chat_boost
#1474
base: dev-3.x
Are you sure you want to change the base?
Conversation
✔️ Changelog found.Thank you for adding a description of the changes |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-3.x #1474 +/- ##
===========================================
- Coverage 100.00% 99.99% -0.01%
===========================================
Files 422 422
Lines 10937 10939 +2
===========================================
+ Hits 10937 10938 +1
- Misses 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@Desiders, please add some related tests |
I added this, but I'm not sure that this test is right in this case |
source = ChatBoostSourceGiftCode(user=user) | ||
boost = ChatBoost(boost_id="Test", add_date=add_date, expiration_date=expiration_date, source=source) | ||
update = Update(update_id=42, chat_boost=ChatBoostUpdated(chat=chat, boost=boost)) | ||
|
||
await middleware(next_handler, update, data) | ||
|
||
event_context = data["event_context"] | ||
assert isinstance(event_context, EventContext) | ||
assert event_context.chat is chat | ||
assert event_context.user is None | ||
assert event_context.thread_id is None | ||
assert data["event_chat"] is chat | ||
assert data.get("event_from_user") is None | ||
assert data.get("event_thread_id") is None | ||
|
||
data.clear() |
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.
Use parametrize to repeat the test with other params
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.
Also try to find other tests covering neighbour data in context. Looks like we just need to add params to existing test
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.
I don't understand what you mean by
Looks like we just need to add params to existing test
test_call
test or the test that I wrote?
I don't see the point in the first test and how to cover the current case.
Close: #1472