Skip to content

Commit

Permalink
fix(hook_middleware.py): format the list comprehension for better rea…
Browse files Browse the repository at this point in the history
…dability

fix(custom_request_middleware.py): remove extra blank line
fix(callbacks_controller.py): change single quotes to double quotes for consistency
fix(routes_test.py): format the assert statement for better readability
  • Loading branch information
marcuxyz committed Nov 17, 2023
1 parent 0d8571a commit 3852e77
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion mvc_flask/middlewares/hook_middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class HookMiddleware:
def register(self, controller_instance, blueprint_instance):
attrs = [attr for attr in dir(controller_instance) if attr in self.accept_attributes]
attrs = [
attr for attr in dir(controller_instance) if attr in self.accept_attributes
]

if attrs:
for attr in attrs:
Expand Down
1 change: 1 addition & 0 deletions mvc_flask/middlewares/http/custom_request_middleware.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import Request


class CustomRequestMiddleware(Request):
@property
def form(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/app/controllers/callbacks_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CallbacksController:
before_request = ['before']
before_request = ["before"]

def index(self):
return self.page
Expand Down
7 changes: 6 additions & 1 deletion tests/routes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@


def test_when_blueprints_have_been_registered(client):
assert set(client.application.blueprints) == {"messages", "health", "posts", "callbacks"}
assert set(client.application.blueprints) == {
"messages",
"health",
"posts",
"callbacks",
}


def test_when_not_exists_registered_blueprints(client):
Expand Down

0 comments on commit 3852e77

Please sign in to comment.