Browse Source

move hapic.set_context method

Bastien Sevajol 6 years ago
parent
commit
50bdebfcce
1 changed files with 4 additions and 4 deletions
  1. 4 4
      hapic/hapic.py

+ 4 - 4
hapic/hapic.py View File

74
     def context(self) -> ContextInterface:
74
     def context(self) -> ContextInterface:
75
         return self._context
75
         return self._context
76
 
76
 
77
+    def set_context(self, context: ContextInterface) -> None:
78
+        assert not self._context
79
+        self._context = context
80
+
77
     def with_api_doc(self):
81
     def with_api_doc(self):
78
         def decorator(func):
82
         def decorator(func):
79
             @functools.wraps(func)
83
             @functools.wraps(func)
102
 
106
 
103
         return decorator
107
         return decorator
104
 
108
 
105
-    def set_context(self, context: ContextInterface) -> None:
106
-        assert not self._context
107
-        self._context = context
108
-
109
     def output_body(
109
     def output_body(
110
         self,
110
         self,
111
         schema: typing.Any,
111
         schema: typing.Any,