Skip to content

Commit 443f412

Browse files
authored
Python worker version 1.0.4 (#621)
* Python worker version 1.0.4 * Update eventhub testcases
1 parent 15557a1 commit 443f412

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def run(self):
254254

255255
setup(
256256
name='azure-functions-worker',
257-
version='1.0.3',
257+
version='1.0.4',
258258
description='Python Language Worker for Azure Functions Host',
259259
classifiers=[
260260
'License :: OSI Approved :: MIT License',
@@ -278,7 +278,7 @@ def run(self):
278278
],
279279
extras_require={
280280
'dev': [
281-
'azure-functions==1.0.8',
281+
'azure-functions==1.1.0',
282282
'flake8~=3.7.9',
283283
'mypy',
284284
'pytest',

tests/unittests/test_mock_eventhub_functions.py

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,22 @@ async def call_and_check():
3131
),
3232
],
3333
metadata={
34-
'iothub-device-id': protos.TypedData(
35-
string='mock-iothub-device-id'
36-
),
37-
'iothub-auth-data': protos.TypedData(
38-
string='mock-iothub-auth-data'
39-
)
34+
'SystemProperties': protos.TypedData(json=json.dumps({
35+
'iothub-device-id': 'mock-iothub-device-id',
36+
'iothub-auth-data': 'mock-iothub-auth-data',
37+
'EnqueuedTimeUtc': '2020-02-18T21:28:42.5888539Z'
38+
}))
4039
}
4140
)
4241

4342
self.assertEqual(r.response.result.status,
4443
protos.StatusResult.Success)
45-
self.assertIn(
46-
'mock-iothub-device-id',
47-
r.response.return_value.string
48-
)
44+
45+
res_json_string = r.response.return_value.string
46+
self.assertIn('device-id', res_json_string)
47+
self.assertIn('mock-iothub-device-id', res_json_string)
48+
self.assertIn('auth-data', res_json_string)
49+
self.assertIn('mock-iothub-auth-data', res_json_string)
4950

5051
await call_and_check()
5152

@@ -70,7 +71,13 @@ async def test_mock_eventhub_cardinality_one(self):
7071
),
7172
),
7273
],
73-
metadata={}
74+
metadata={
75+
'SystemProperties': protos.TypedData(json=json.dumps({
76+
'iothub-device-id': 'mock-iothub-device-id',
77+
'iothub-auth-data': 'mock-iothub-auth-data',
78+
'EnqueuedTimeUtc': '2020-02-18T21:28:42.5888539Z'
79+
}))
80+
}
7481
)
7582

7683
self.assertEqual(r.response.result.status,
@@ -104,13 +111,21 @@ async def test_mock_eventhub_cardinality_many(self):
104111
protos.ParameterBinding(
105112
name='events',
106113
data=protos.TypedData(
107-
json=json.dumps({
114+
json=json.dumps([{
108115
'id': 'cardinality_many'
109-
})
116+
}])
110117
),
111118
),
112119
],
113-
metadata={}
120+
metadata={
121+
'SystemPropertiesArray': protos.TypedData(json=json.dumps([
122+
{
123+
'iothub-device-id': 'mock-iothub-device-id',
124+
'iothub-auth-data': 'mock-iothub-auth-data',
125+
'EnqueuedTimeUtc': '2020-02-18T21:28:42.5888539Z'
126+
}
127+
]))
128+
}
114129
)
115130

116131
self.assertEqual(r.response.result.status,

0 commit comments

Comments
 (0)