Skip to content

Commit

Permalink
Fix coverage (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
pristupa authored Apr 6, 2021
1 parent 203c70e commit 5842665
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
7 changes: 4 additions & 3 deletions winter/web/configurer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import abc
from abc import ABC
from abc import abstractmethod

from .controller import get_instance
from .interceptor import InterceptorRegistry
from .interceptor import interceptor_registry


class Configurer(abc.ABC):
@abc.abstractmethod
class Configurer(ABC):
@abstractmethod
def add_interceptors(self, registry: InterceptorRegistry):
pass

Expand Down
7 changes: 4 additions & 3 deletions winter/web/exceptions/exception_handler_generator.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import abc
from abc import ABC
from abc import abstractmethod
from typing import Type

from .handlers import ExceptionHandler
from .problem_handling_info import ProblemHandlingInfo


class ExceptionHandlerGenerator(abc.ABC):
@abc.abstractmethod
class ExceptionHandlerGenerator(ABC):
@abstractmethod
def generate(self, exception_class: Type[Exception], handling_info: ProblemHandlingInfo) -> Type[ExceptionHandler]:
pass
7 changes: 4 additions & 3 deletions winter/web/exceptions/exception_mapper.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import abc
from abc import ABC
from abc import abstractmethod
from typing import Any

from rest_framework.request import Request

from .problem_handling_info import ProblemHandlingInfo


class ExceptionMapper(abc.ABC):
@abc.abstractmethod
class ExceptionMapper(ABC):
@abstractmethod
def to_response_body(self, request: Request, exception: Exception, handling_info: ProblemHandlingInfo) -> Any:
pass
7 changes: 4 additions & 3 deletions winter/web/interceptor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import abc
from abc import ABC
from abc import abstractmethod


class Interceptor(abc.ABC):
@abc.abstractmethod
class Interceptor(ABC):
@abstractmethod
def pre_handle(self, **kwargs):
pass

Expand Down
4 changes: 0 additions & 4 deletions winter/web/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import enum
import inspect
import types
import uuid
from typing import Iterable
Expand Down Expand Up @@ -40,9 +39,6 @@ def rewrite_uritemplate_with_regexps(url_path: str, methods: Iterable[ComponentM
def get_regexp(type_=None) -> str:
origin_type = get_origin_type(type_)

if not inspect.isclass(origin_type):
origin_type = type(origin_type)

for cls in origin_type.mro():
func = _regexp.get(cls)

Expand Down

0 comments on commit 5842665

Please sign in to comment.