Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 1, 2023
1 parent ef65fc6 commit 70fc265
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 26 deletions.
1 change: 0 additions & 1 deletion integration_tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_invalid_authentication_token(session, function_type: str):
assert r.headers.get("WWW-Authenticate") == "BearerGetter"



@pytest.mark.benchmark
@pytest.mark.parametrize("function_type", ["sync", "async"])
def test_invalid_authentication_header(session, function_type: str):
Expand Down
13 changes: 2 additions & 11 deletions robyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,9 @@
from robyn.logger import logger
from robyn.processpool import run_processes
from robyn.responses import serve_file, serve_html
from robyn.robyn import (
FunctionInfo,
HttpMethod,
Request,
Response,
get_version,
jsonify,
WebSocketConnector,
Headers
)
from robyn.robyn import FunctionInfo, HttpMethod, Request, Response, get_version, jsonify, WebSocketConnector, Headers
from robyn.router import MiddlewareRouter, MiddlewareType, Router, WebSocketRouter
from robyn.types import Directory, Header
from robyn.types import Directory
from robyn import status_codes
from robyn.ws import WebSocket

Expand Down
4 changes: 2 additions & 2 deletions robyn/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class BearerGetter(TokenGetter):

@classmethod
def get_token(cls, request: Request) -> Optional[str]:
if request.headers.contains("authorization") :
authorization_header = request.headers.get("authorization")
if request.headers.contains("authorization"):
authorization_header = request.headers.get("authorization")
else:
authorization_header = None

Expand Down
2 changes: 1 addition & 1 deletion robyn/processpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from robyn.events import Events
from robyn.robyn import FunctionInfo, Headers, Server, SocketHeld
from robyn.router import GlobalMiddleware, RouteMiddleware, Route
from robyn.types import Directory, Header
from robyn.types import Directory
from robyn.ws import WebSocket


Expand Down
8 changes: 0 additions & 8 deletions robyn/robyn.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ class Url:
class Identity:
claims: dict[str, str]





@dataclass
class QueryParams:
"""
Expand Down Expand Up @@ -156,11 +152,9 @@ class QueryParams:
pass

class Headers:

def __init__(self, default_headers: Optional[dict]) -> None:
pass


def set(self, key: str, value: str) -> None:
"""
Sets the value of the header with the given key.
Expand Down Expand Up @@ -191,11 +185,9 @@ class Headers:
"""
pass


def is_empty(self) -> bool:
pass


@dataclass
class Request:
"""
Expand Down
3 changes: 0 additions & 3 deletions robyn/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from robyn import status_codes

from robyn.ws import WebSocket
from robyn.types import Header


class Route(NamedTuple):
Expand Down Expand Up @@ -59,7 +58,6 @@ def _format_response(
if not headers.contains("Content-Type"):
headers.set("Content-Type", "text/plain")


description = res.get("description", "")

if not isinstance(status_code, int):
Expand Down Expand Up @@ -94,7 +92,6 @@ def add_route(
is_const: bool,
exception_handler: Optional[Callable],
) -> Union[Callable, CoroutineType]:

@wraps(handler)
async def async_inner_handler(*args):
try:
Expand Down

0 comments on commit 70fc265

Please sign in to comment.