@@ -31,21 +31,22 @@ async def call_and_check():
31
31
),
32
32
],
33
33
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
+ }))
40
39
}
41
40
)
42
41
43
42
self .assertEqual (r .response .result .status ,
44
43
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 )
49
50
50
51
await call_and_check ()
51
52
@@ -70,7 +71,13 @@ async def test_mock_eventhub_cardinality_one(self):
70
71
),
71
72
),
72
73
],
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
+ }
74
81
)
75
82
76
83
self .assertEqual (r .response .result .status ,
@@ -104,13 +111,21 @@ async def test_mock_eventhub_cardinality_many(self):
104
111
protos .ParameterBinding (
105
112
name = 'events' ,
106
113
data = protos .TypedData (
107
- json = json .dumps ({
114
+ json = json .dumps ([ {
108
115
'id' : 'cardinality_many'
109
- })
116
+ }] )
110
117
),
111
118
),
112
119
],
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
+ }
114
129
)
115
130
116
131
self .assertEqual (r .response .result .status ,
0 commit comments