Skip to content

Commit bcee98d

Browse files
author
Evan Roman
committed
Check issue
1 parent d242552 commit bcee98d

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

tests/extension_tests/deferred_bindings_tests/deferred_bindings_eventhub_functions/function_app.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
99

1010

11-
@app.function_name(name="put_bc_trigger")
12-
@app.blob_output(arg_name="file",
13-
path="python-worker-tests/test-blobclient-trigger.txt",
14-
connection="AzureWebJobsStorage")
15-
@app.route(route="put_bc_trigger")
16-
def put_bc_trigger(req: func.HttpRequest, file: func.Out[str]) -> str:
17-
file.set(req.get_body())
18-
return 'OK'
11+
# @app.function_name(name="put_bc_trigger")
12+
# @app.blob_output(arg_name="file",
13+
# path="python-worker-tests/test-blobclient-trigger.txt",
14+
# connection="AzureWebJobsStorage")
15+
# @app.route(route="put_bc_trigger")
16+
# def put_bc_trigger(req: func.HttpRequest, file: func.Out[str]) -> str:
17+
# file.set(req.get_body())
18+
# return 'OK'
1919

2020
# An HttpTrigger to generating EventHub event from EventHub Output Binding
21-
# @app.function_name(name="eventhub_output")
22-
# @app.route(route="eventhub_output")
23-
# @app.event_hub_output(arg_name="event",
24-
# event_hub_name="python-worker-ci-eventhub-one",
25-
# connection="AzureWebJobsEventHubConnectionString")
26-
# def eventhub_output(req: func.HttpRequest, event: func.Out[str]) -> str:
27-
# event.set(req.get_body().decode('utf-8'))
28-
# return 'OK'
21+
@app.function_name(name="eventhub_output")
22+
@app.event_hub_output(arg_name="event",
23+
event_hub_name="python-worker-ci-eventhub-one",
24+
connection="AzureWebJobsEventHubConnectionString")
25+
@app.route(route="eventhub_output")
26+
def eventhub_output(req: func.HttpRequest, event: func.Out[str]) -> str:
27+
# event.set(req.get_body().decode('utf-8'))
28+
return 'OK'
2929

3030
# # This is an actual EventHub trigger which will convert the event data
3131
# # into a storage blob.

tests/extension_tests/deferred_bindings_tests/test_deferred_bindings_eventhub_functions.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
import os
34
import sys
45
import time
56
import unittest
@@ -23,10 +24,10 @@ def get_libraries_to_install(cls):
2324
def test_ed_eventhub_trigger(self):
2425
# data = "DummyData"
2526

26-
r = self.webhost.request('POST', 'put_bc_trigger',
27+
r = self.webhost.request('POST', 'eventhub_output',
2728
data="test")
28-
self.assertEqual(r.status_code, 200)
29-
# self.assertEqual(r.text, 'OK')
29+
# self.assertEqual(r.status_code, 200)
30+
self.assertEqual(r.text, f"AzureWebJobsEventHubConnectionString: {os.getenv('AzureWebJobsEventHubConnectionString')}, AzureWebJobsStorage: {os.getenv('AzureWebJobsStorage')}")
3031

3132
# # Once the event get generated, allow function host to poll from
3233
# # EventHub and wait for eventhub_trigger to execute,

0 commit comments

Comments
 (0)