File tree Expand file tree Collapse file tree 4 files changed +16
-43
lines changed
tests/components/uptimerobot Expand file tree Collapse file tree 4 files changed +16
-43
lines changed Original file line number Diff line number Diff line change 4747 "type" : 1 ,
4848 "url" : "http://example.com" ,
4949}
50-
50+ MOCK_UPTIMEROBOT_MONITOR_2 = {
51+ "id" : 5678 ,
52+ "friendly_name" : "Test monitor 2" ,
53+ "status" : 2 ,
54+ "type" : 1 ,
55+ "url" : "http://example2.com" ,
56+ }
5157
5258MOCK_UPTIMEROBOT_CONFIG_ENTRY_DATA = {
5359 "domain" : DOMAIN ,
Original file line number Diff line number Diff line change 1515
1616from .common import (
1717 MOCK_UPTIMEROBOT_MONITOR ,
18+ MOCK_UPTIMEROBOT_MONITOR_2 ,
1819 UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY ,
1920 mock_uptimerobot_api_response ,
2021 setup_uptimerobot_integration ,
@@ -65,20 +66,8 @@ async def test_binary_sensor_dynamic(hass: HomeAssistant) -> None:
6566 "pyuptimerobot.UptimeRobot.async_get_monitors" ,
6667 return_value = mock_uptimerobot_api_response (
6768 data = [
68- {
69- "id" : 1234 ,
70- "friendly_name" : "Test monitor" ,
71- "status" : 2 ,
72- "type" : 1 ,
73- "url" : "http://example.com" ,
74- },
75- {
76- "id" : 5678 ,
77- "friendly_name" : "Test monitor 2" ,
78- "status" : 2 ,
79- "type" : 1 ,
80- "url" : "http://example2.com" ,
81- },
69+ MOCK_UPTIMEROBOT_MONITOR ,
70+ MOCK_UPTIMEROBOT_MONITOR_2 ,
8271 ]
8372 ),
8473 ):
Original file line number Diff line number Diff line change 1212
1313from .common import (
1414 MOCK_UPTIMEROBOT_MONITOR ,
15+ MOCK_UPTIMEROBOT_MONITOR_2 ,
1516 STATE_UP ,
1617 UPTIMEROBOT_SENSOR_TEST_ENTITY ,
1718 mock_uptimerobot_api_response ,
@@ -69,20 +70,8 @@ async def test_sensor_dynamic(hass: HomeAssistant) -> None:
6970 "pyuptimerobot.UptimeRobot.async_get_monitors" ,
7071 return_value = mock_uptimerobot_api_response (
7172 data = [
72- {
73- "id" : 1234 ,
74- "friendly_name" : "Test monitor" ,
75- "status" : 2 ,
76- "type" : 1 ,
77- "url" : "http://example.com" ,
78- },
79- {
80- "id" : 5678 ,
81- "friendly_name" : "Test monitor 2" ,
82- "status" : 2 ,
83- "type" : 1 ,
84- "url" : "http://example2.com" ,
85- },
73+ MOCK_UPTIMEROBOT_MONITOR ,
74+ MOCK_UPTIMEROBOT_MONITOR_2 ,
8675 ]
8776 ),
8877 ):
Original file line number Diff line number Diff line change 2121from .common import (
2222 MOCK_UPTIMEROBOT_CONFIG_ENTRY_DATA ,
2323 MOCK_UPTIMEROBOT_MONITOR ,
24+ MOCK_UPTIMEROBOT_MONITOR_2 ,
2425 MOCK_UPTIMEROBOT_MONITOR_PAUSED ,
2526 UPTIMEROBOT_SWITCH_TEST_ENTITY ,
2627 MockApiResponseKey ,
@@ -197,20 +198,8 @@ async def test_switch_dynamic(hass: HomeAssistant) -> None:
197198 "pyuptimerobot.UptimeRobot.async_get_monitors" ,
198199 return_value = mock_uptimerobot_api_response (
199200 data = [
200- {
201- "id" : 1234 ,
202- "friendly_name" : "Test monitor" ,
203- "status" : 2 ,
204- "type" : 1 ,
205- "url" : "http://example.com" ,
206- },
207- {
208- "id" : 5678 ,
209- "friendly_name" : "Test monitor 2" ,
210- "status" : 2 ,
211- "type" : 1 ,
212- "url" : "http://example2.com" ,
213- },
201+ MOCK_UPTIMEROBOT_MONITOR ,
202+ MOCK_UPTIMEROBOT_MONITOR_2 ,
214203 ]
215204 ),
216205 ):
You can’t perform that action at this time.
0 commit comments