@@ -122,7 +122,6 @@ async def test_childdevicewrapper_error(dummy_protocol, mocker):
122
122
await wrapped_protocol .query (DUMMY_QUERY )
123
123
124
124
125
- @pytest .mark .skip ("childprotocolwrapper does not yet support multirequests" )
126
125
async def test_childdevicewrapper_unwrapping_multiplerequest (dummy_protocol , mocker ):
127
126
"""Test that unwrapping multiplerequest works correctly."""
128
127
mock_response = {
@@ -146,13 +145,12 @@ async def test_childdevicewrapper_unwrapping_multiplerequest(dummy_protocol, moc
146
145
}
147
146
},
148
147
}
149
-
150
- mocker .patch .object (dummy_protocol ._transport , "send" , return_value = mock_response )
151
- resp = await dummy_protocol .query (DUMMY_QUERY )
148
+ wrapped_protocol = _ChildProtocolWrapper ( "dummyid" , dummy_protocol )
149
+ mocker .patch .object (wrapped_protocol ._transport , "send" , return_value = mock_response )
150
+ resp = await wrapped_protocol .query (DUMMY_QUERY )
152
151
assert resp == {"get_device_info" : {"foo" : "bar" }, "second_command" : {"bar" : "foo" }}
153
152
154
153
155
- @pytest .mark .skip ("childprotocolwrapper does not yet support multirequests" )
156
154
async def test_childdevicewrapper_multiplerequest_error (dummy_protocol , mocker ):
157
155
"""Test that errors inside multipleRequest response of responseData raise an exception."""
158
156
mock_response = {
@@ -172,7 +170,7 @@ async def test_childdevicewrapper_multiplerequest_error(dummy_protocol, mocker):
172
170
}
173
171
},
174
172
}
175
-
176
- mocker .patch .object (dummy_protocol ._transport , "send" , return_value = mock_response )
173
+ wrapped_protocol = _ChildProtocolWrapper ( "dummyid" , dummy_protocol )
174
+ mocker .patch .object (wrapped_protocol ._transport , "send" , return_value = mock_response )
177
175
with pytest .raises (KasaException ):
178
- await dummy_protocol .query (DUMMY_QUERY )
176
+ await wrapped_protocol .query (DUMMY_QUERY )
0 commit comments