Enabling implicit output for generic bindings (#1348)
* Enabling implicit output for generic bindings * Fixing comments --------- Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
This commit is contained in:
Родитель
56f5caf097
Коммит
a981fcf788
|
@ -52,4 +52,4 @@ class GenericBinding:
|
|||
|
||||
@classmethod
|
||||
def has_implicit_output(cls) -> bool:
|
||||
return False
|
||||
return True
|
||||
|
|
|
@ -131,7 +131,7 @@ class TestGenericFunctions(testutils.AsyncTestCase):
|
|||
protos.StatusResult.Success)
|
||||
|
||||
_, r = await host.invoke_function(
|
||||
'foobar_as_bytes_no_anno', [
|
||||
'foobar_implicit_output', [
|
||||
protos.ParameterBinding(
|
||||
name='input',
|
||||
data=protos.TypedData(
|
||||
|
@ -140,10 +140,10 @@ class TestGenericFunctions(testutils.AsyncTestCase):
|
|||
)
|
||||
]
|
||||
)
|
||||
# It should fail here, since generic binding requires
|
||||
# $return statement in function.json to pass output
|
||||
# It passes now as we are enabling generic binding to return output
|
||||
# implicitly
|
||||
self.assertEqual(r.response.result.status,
|
||||
protos.StatusResult.Failure)
|
||||
protos.StatusResult.Success)
|
||||
|
||||
async def test_mock_generic_should_support_without_datatype(self):
|
||||
async with testutils.start_mockhost(
|
||||
|
@ -166,7 +166,7 @@ class TestGenericFunctions(testutils.AsyncTestCase):
|
|||
)
|
||||
]
|
||||
)
|
||||
# It should fail here, since the generic binding requires datatype
|
||||
# to be defined in function.json
|
||||
# It passes now as we are enabling generic binding to return output
|
||||
# implicitly
|
||||
self.assertEqual(r.response.result.status,
|
||||
protos.StatusResult.Failure)
|
||||
protos.StatusResult.Success)
|
||||
|
|
Загрузка…
Ссылка в новой задаче