Increase Tomato request timeout (#104203)

* tomato integration timeout fixed

* update tests in tomato integration
This commit is contained in:
Rene Nemec 2023-11-19 22:49:40 +00:00 committed by GitHub
parent a1678ebd23
commit f8e3f1497c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -100,10 +100,10 @@ class TomatoDeviceScanner(DeviceScanner):
try:
if self.ssl:
response = requests.Session().send(
self.req, timeout=3, verify=self.verify_ssl
self.req, timeout=60, verify=self.verify_ssl
)
else:
response = requests.Session().send(self.req, timeout=3)
response = requests.Session().send(self.req, timeout=60)
# Calling and parsing the Tomato api here. We only need the
# wldev and dhcpd_lease values.

View file

@ -157,7 +157,7 @@ def test_config_verify_ssl_but_no_ssl_enabled(
assert "_http_id=1234567890" in result.req.body
assert "exec=devlist" in result.req.body
assert mock_session_send.call_count == 1
assert mock_session_send.mock_calls[0] == mock.call(result.req, timeout=3)
assert mock_session_send.mock_calls[0] == mock.call(result.req, timeout=60)
@mock.patch("os.access", return_value=True)
@ -192,7 +192,7 @@ def test_config_valid_verify_ssl_path(hass: HomeAssistant, mock_session_send) ->
assert "exec=devlist" in result.req.body
assert mock_session_send.call_count == 1
assert mock_session_send.mock_calls[0] == mock.call(
result.req, timeout=3, verify="/test/tomato.crt"
result.req, timeout=60, verify="/test/tomato.crt"
)
@ -223,7 +223,7 @@ def test_config_valid_verify_ssl_bool(hass: HomeAssistant, mock_session_send) ->
assert "exec=devlist" in result.req.body
assert mock_session_send.call_count == 1
assert mock_session_send.mock_calls[0] == mock.call(
result.req, timeout=3, verify=False
result.req, timeout=60, verify=False
)