refactor server.py for using Blueprint#3033
Conversation
ReimarBauer
left a comment
There was a problem hiding this comment.
That's good progress. We can already see it's becoming much more readable. You need to rearrange a few things.
The blueprints should contain as few additional functions as possible.
Especially not ones that need to be imported from other blueprints.
see comments
efd14d0 to
570f809
Compare
ReimarBauer
left a comment
There was a problem hiding this comment.
This is a comprehensive structural refactoring that has been very well implemented in large parts. Nevertheless, I have noticed some points that could lead to immediate problems during deployment. Additionally, some regressions have occurred; I should have checked these more thoroughly during my initial review.
Adjusted tests to call the new method name.
| @@ -43,15 +45,15 @@ def setup(self, mscolab_app): | |||
| self.userdata = 'UV10@uv10', 'UV10', 'uv10', 'User UV' | |||
|
|
|||
There was a problem hiding this comment.
# enable basic auth
self.app.config['ENABLE_BASIC_HTTP_AUTHENTICATION'] = True
yield
self.app.config['ENABLE_BASIC_HTTP_AUTHENTICATION'] = False
| try: | ||
| from mslib.mscolab.server import authfunc, verify_pw, initialize_managers, get_auth_token, register_user | ||
| from mslib.mscolab.server import authfunc, verify_pw, _initialize_managers | ||
| from mslib.mscolab.blueprints.auth import get_auth_token |
There was a problem hiding this comment.
when you use with self.app.test_client() as test_client: and call the server by a post request,
you don't need
from mslib.mscolab.blueprints.auth import get_auth_token
from mslib.mscolab.auth import register_user
both can become removed
Purpose of PR?:
Fixes #2081
Does this PR introduce a breaking change?
included Blueprint, fixed test_load_no_file
If the changes in this PR are manually verified, list down the scenarios covered::
tests succeed, not manually verified
Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes
Checklist:
<type>: <subject>