Skip to content

Commit 9919a1b

Browse files
committed
cover
1 parent 82009d3 commit 9919a1b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tests/test_server_disconnected_retry.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,17 @@ async def test_post_xml_decorator_is_applied(mock_etree_to_string: MagicMock) ->
390390
mock_envelope = Mock()
391391
mock_envelope.tag = "TestEnvelope"
392392

393-
with patch("onvif.zeep_aiohttp.etree_to_string", return_value=b"<test/>"):
394-
# Set up to fail twice (max retries)
395-
mock_session.post = AsyncMock(
396-
side_effect=aiohttp.ServerDisconnectedError("Server disconnected")
397-
)
393+
# Set up to fail twice (max retries)
394+
mock_session.post = AsyncMock(
395+
side_effect=aiohttp.ServerDisconnectedError("Server disconnected")
396+
)
398397

399-
# Should raise after 2 attempts
400-
with pytest.raises(aiohttp.ServerDisconnectedError):
401-
await transport.post_xml("http://example.com/onvif", mock_envelope, {})
398+
# Should raise after 2 attempts
399+
with pytest.raises(aiohttp.ServerDisconnectedError):
400+
await transport.post_xml("http://example.com/onvif", mock_envelope, {})
402401

403-
# Verify it was called exactly twice (2 attempts as configured)
404-
assert mock_session.post.call_count == 2
402+
# Verify it was called exactly twice (2 attempts as configured)
403+
assert mock_session.post.call_count == 2
405404

406405

407406
@pytest.mark.asyncio

0 commit comments

Comments
 (0)