all tests passed

This commit is contained in:
2025-05-06 21:53:53 +03:00
parent 477f3a7dec
commit 61ef6a6466
6 changed files with 154 additions and 110 deletions
+3
View File
@@ -58,6 +58,9 @@ class BaseFlags(Generic[FlagType]):
def __getitem__(self, item):
return self._flags[item]
def __bool__(self):
return bool(self._flags)
def __eq__(self, other):
if len(self.get_flags()) != len(other.get_flags()):
return False
+7 -5
View File
@@ -158,11 +158,13 @@ class Router:
elif len(transferred_args) == 0:
raise RequiredArgumentNotPassedException()
arg_annotation: Type = get_annotations(func)[transferred_args[0]]
if not arg_annotation is Response:
Console().print(f'\n\nFile "{getsourcefile(func)}", line {getsourcelines(func)[1]+1}\n'
f'[b red]WARNING:[/b red] [i]The typehint of argument([green]{transferred_args[0]}[/green]) passed to the handler is [/i][blue]{Response}[/blue],'
f' [i]but[/i] [bold blue]{arg_annotation}[/bold blue] [i]is specified[/i]', highlight=False)
func_annotations: dict[str, Type] = get_annotations(func)
if func_annotations:
arg_annotation: Type = func_annotations[transferred_args[0]]
if not arg_annotation is Response:
Console().print(f'\n\nFile "{getsourcefile(func)}", line {getsourcelines(func)[1]+1}\n'
f'[b red]WARNING:[/b red] [i]The typehint of argument([green]{transferred_args[0]}[/green]) passed to the handler is [/i][blue]{Response}[/blue],'
f' [i]but[/i] [bold blue]{arg_annotation}[/bold blue] [i]is specified[/i]', highlight=False)