vk: improve code quality#617
Conversation
Codecov Report
@@ Coverage Diff @@
## master #617 +/- ##
==========================================
- Coverage 76.92% 76.92% -0.01%
==========================================
Files 317 317
Lines 9630 9641 +11
Branches 962 964 +2
==========================================
+ Hits 7408 7416 +8
- Misses 2071 2073 +2
- Partials 151 152 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| def make_sure_access_token_exists(self, method, data): | ||
| if 'access_token' in data: | ||
| return data |
There was a problem hiding this comment.
Seems like access_token is always present, maybe the code can be simplified?
There was a problem hiding this comment.
I'm afraid it's not, when we call the method from VKAppOAuth2, we don't have access_token.
There was a problem hiding this comment.
Ah, I missed the isAppUser call when reviewing, and lack of test coverage there made me think it is not used. Can you add tests for that?
Proposed changes
I wanted to improve code quality of a VK back-end, because I had a problem when I wanted to extend it. So I decided it's a good idea to move
vk_apifunction to class implementation, so we can use an inheritance with full power.Types of changes
Please check the type of change your PR introduces:
Checklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
Other information
Any other information that is important to this PR such as screenshots of how
the component looks before and after the change.