Add timeout option to sensor.rest and binary_sensor.rest. (#20065)

This commit is contained in:
Giorgos Logiotatidis authored and Paulus Schoutsen committed 2019-02-26 10:23:46 -08:00
1 parent 90d3f517d8
commit 5a5c97acb3
3 files changed
+22 -7

No files matched your search

+5 -1
View File
@@ -89,6 +89,7 @@ class TestRestSensorSetup(unittest.TestCase):
'name': 'foo',
'unit_of_measurement': 'MB',
'verify_ssl': 'true',
'timeout': 30,
'authentication': 'basic',
'username': 'my username',
'password': 'my password',
@@ -112,6 +113,7 @@ class TestRestSensorSetup(unittest.TestCase):
'name': 'foo',
'unit_of_measurement': 'MB',
'verify_ssl': 'true',
'timeout': 30,
'authentication': 'basic',
'username': 'my username',
'password': 'my password',
@@ -280,8 +282,10 @@ class TestRestData(unittest.TestCase):
self.method = "GET"
self.resource = "http://localhost"
self.verify_ssl = True
self.timeout = 10
self.rest = rest.RestData(
self.method, self.resource, None, None, None, self.verify_ssl)
self.method, self.resource, None, None, None, self.verify_ssl,
self.timeout)
@requests_mock.Mocker()
def test_update(self, mock_req):