def test_callable_and_async_signature_with_no_parameters(self):
# Signature without parameters (i.e. primitives), only input artifacts.
method = self.plugin.methods['merge_mappings']
for callable_attr in '__call__', 'async':
signature = inspect.Signature.from_callable(
getattr(method, callable_attr))
parameters = list(signature.parameters.items())
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('mapping1', inspect.Parameter(
'mapping1', kind, annotation=Mapping)),
('mapping2', inspect.Parameter(
'mapping2', kind, annotation=Mapping))
]
self.assertEqual(parameters, exp_parameters)
评论列表
文章目录