Skip to content

Commit f269c09

Browse files
gavin-aguiarroot
and
root
authored
Revert "Enabling implicit output for generic bindings (#1348)" (#1376)
This reverts commit a981fcf. Co-authored-by: root <root@GavinPC>
1 parent a6f40f1 commit f269c09

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

azure_functions_worker/bindings/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ def decode(cls, data: datumdef.Datum, *, trigger_metadata) -> typing.Any:
5252

5353
@classmethod
5454
def has_implicit_output(cls) -> bool:
55-
return True
55+
return False

tests/unittests/test_mock_generic_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def test_mock_generic_should_not_support_implicit_output(self):
131131
protos.StatusResult.Success)
132132

133133
_, r = await host.invoke_function(
134-
'foobar_implicit_output', [
134+
'foobar_as_bytes_no_anno', [
135135
protos.ParameterBinding(
136136
name='input',
137137
data=protos.TypedData(
@@ -140,10 +140,10 @@ async def test_mock_generic_should_not_support_implicit_output(self):
140140
)
141141
]
142142
)
143-
# It passes now as we are enabling generic binding to return output
144-
# implicitly
143+
# It should fail here, since generic binding requires
144+
# $return statement in function.json to pass output
145145
self.assertEqual(r.response.result.status,
146-
protos.StatusResult.Success)
146+
protos.StatusResult.Failure)
147147

148148
async def test_mock_generic_should_support_without_datatype(self):
149149
async with testutils.start_mockhost(
@@ -166,7 +166,7 @@ async def test_mock_generic_should_support_without_datatype(self):
166166
)
167167
]
168168
)
169-
# It passes now as we are enabling generic binding to return output
170-
# implicitly
169+
# It should fail here, since the generic binding requires datatype
170+
# to be defined in function.json
171171
self.assertEqual(r.response.result.status,
172-
protos.StatusResult.Success)
172+
protos.StatusResult.Failure)

0 commit comments

Comments
 (0)