Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/connexion/frameworks/abstract.py: 79%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

24 statements  

1import abc 

2import typing as t 

3 

4from typing_extensions import Protocol 

5 

6 

7class Framework(Protocol): 

8 @staticmethod 

9 @abc.abstractmethod 

10 def is_framework_response(response: t.Any) -> bool: 

11 """Return True if provided response is a framework type""" 

12 raise NotImplementedError 

13 

14 @classmethod 

15 @abc.abstractmethod 

16 def connexion_to_framework_response(cls, response): 

17 """Cast ConnexionResponse to framework response class""" 

18 raise NotImplementedError 

19 

20 @classmethod 

21 @abc.abstractmethod 

22 def build_response( 

23 cls, 

24 data: t.Any, 

25 *, 

26 content_type: str = None, 

27 headers: dict = None, 

28 status_code: int = None 

29 ): 

30 raise NotImplementedError 

31 

32 @staticmethod 

33 @abc.abstractmethod 

34 def get_request(*args, **kwargs): 

35 """Return a framework request from the context.""" 

36 raise NotImplementedError 

37 

38 @staticmethod 

39 @abc.abstractmethod 

40 def get_body(request): 

41 """Get body from a framework request""" 

42 raise NotImplementedError