Procházet zdrojové kódy

move hapic.set_context method

Bastien Sevajol před 6 roky
rodič
revize
50bdebfcce
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      hapic/hapic.py

+ 4 - 4
hapic/hapic.py Zobrazit soubor

@@ -74,6 +74,10 @@ class Hapic(object):
74 74
     def context(self) -> ContextInterface:
75 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 81
     def with_api_doc(self):
78 82
         def decorator(func):
79 83
             @functools.wraps(func)
@@ -102,10 +106,6 @@ class Hapic(object):
102 106
 
103 107
         return decorator
104 108
 
105
-    def set_context(self, context: ContextInterface) -> None:
106
-        assert not self._context
107
-        self._context = context
108
-
109 109
     def output_body(
110 110
         self,
111 111
         schema: typing.Any,