|
1 | 1 | from cerberus import Validator |
| 2 | +from chk.infrastructure.file_loader import FileContext |
2 | 3 | from chk.infrastructure.work import WorkerContract, ProcessorContract, handle_processor |
| 4 | +from chk.modules.http.request_helper import RequestProcessorMixin_PyRequests |
3 | 5 | from chk.modules.http.support import RequestMixin_V072 |
| 6 | +from chk.modules.variables.support import VariableMixin_V072 |
4 | 7 | from chk.modules.version.support import VersionMixin_V072 |
5 | | -from chk.modules.http.request_helper import RequestProcessorMixin_PyRequests |
6 | 8 |
|
7 | 9 |
|
8 | 10 | class HttpSpec_V072( |
9 | 11 | RequestProcessorMixin_PyRequests, |
10 | | - VersionMixin_V072, RequestMixin_V072, |
11 | | - WorkerContract, ProcessorContract): |
| 12 | + VersionMixin_V072, |
| 13 | + RequestMixin_V072, |
| 14 | + VariableMixin_V072, |
| 15 | + WorkerContract, |
| 16 | + ProcessorContract, |
| 17 | +): |
12 | 18 |
|
13 | | - def __init__(self, doc: dict): |
14 | | - self.document = doc |
15 | | - self.validator = Validator() |
16 | | - self.response = None |
| 19 | + def __init__(self, file_ctx: FileContext): |
| 20 | + self.file_ctx, self.document, self.validator, self.response = file_ctx, file_ctx.document, Validator(), None |
17 | 21 |
|
18 | | - def __before_work__(self) -> None: |
| 22 | + def __work__(self) -> None: |
19 | 23 | VersionMixin_V072.version_validated(self) |
20 | 24 | RequestMixin_V072.request_validated(self) |
| 25 | + VariableMixin_V072.variable_validated(self) |
21 | 26 |
|
22 | | - def __work__(self) -> None: |
23 | | - self.response = handle_processor(self, self.document) |
24 | | - |
25 | | - def __after_work__(self): |
26 | | - pass |
| 27 | + ctx_document = VariableMixin_V072.variable_process(self) |
| 28 | + self.response = handle_processor(self, ctx_document) |
0 commit comments