File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
addon_service/addon_operation Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 77 get_imp_name ,
88)
99from addon_service .common .static_dataclass_model import StaticDataclassModel
10- from addon_toolkit import AddonOperationImp
10+ from addon_toolkit import (
11+ AddonCapabilities ,
12+ AddonOperationImp ,
13+ )
1114from addon_toolkit .json_arguments import jsonschema_for_signature_params
1215from addon_toolkit .operation import AddonOperationType
1316
@@ -42,7 +45,7 @@ def implementation_docstring(self) -> str:
4245 return self .operation_imp .imp_function .__doc__ or ""
4346
4447 @cached_property
45- def capability (self ) -> str :
48+ def capability (self ) -> AddonCapabilities :
4649 return self .operation_imp .declaration .capability
4750
4851 @cached_property
Original file line number Diff line number Diff line change 11from rest_framework_json_api import serializers
22from rest_framework_json_api .utils import get_resource_type_from_model
33
4- from addon_service .addon_imp .models import AddonImp
54from addon_service .common import view_names
65from addon_service .common .enums .serializers import EnumNameChoiceField
76from addon_service .common .serializer_fields import DataclassRelatedDataField
87from addon_toolkit import AddonCapabilities
8+ from addon_toolkit .imp import AddonImp
99
1010from .models import AddonOperationModel
1111
Original file line number Diff line number Diff line change 77 Iterator ,
88)
99
10+ from .capabilities import AddonCapabilities
1011from .declarator import Declarator
1112
1213
@@ -35,7 +36,7 @@ class AddonOperationDeclaration:
3536 """
3637
3738 operation_type : AddonOperationType
38- capability : enum . Enum
39+ capability : AddonCapabilities
3940 operation_fn : Callable # the decorated function
4041 return_type : type = dataclasses .field (
4142 default = type (None ), # if not provided, inferred by __post_init__
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class TestAddonProtocol(unittest.TestCase):
2121 # the basics of an addon protocol
2222
2323 ###
24- # shared test env (on `self` )
24+ # shared test env (initialized by setUpClass )
2525 _MyProtocol : type # typing.Protocol subclass decorated with `@addon_protocol`
2626 _MyImplementation : type # subclass of _MyProtocol
2727 _my_imp : AddonImp
You can’t perform that action at this time.
0 commit comments