Fixed tests

This commit is contained in:
Alex Root Junior 2021-07-31 21:41:19 +03:00
parent a2bafb27e4
commit 6477bf3cf8
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class Command(BaseFilter):
if isinstance(allowed_command, Pattern): # Regexp
result = allowed_command.match(command.command)
if result:
return replace(command, match=result)
return replace(command, regexp_match=result)
elif command.command == allowed_command: # String
return command
raise CommandException("Command did not match pattern")

View file

@ -32,7 +32,7 @@ class ExceptionMessageFilter(BaseFilter):
class Config:
arbitrary_types_allowed = True
@validator("match")
@validator("pattern")
def _validate_match(cls, value: Union[str, Pattern[str]]) -> Union[str, Pattern[str]]:
if isinstance(value, str):
return re.compile(value)