3f29c234b8b2cae1c754bf55cdb2f283f8a62701,tests/components/ring/test_binary_sensor.py,TestRingBinarySensorSetup,test_binary_sensor,#TestRingBinarySensorSetup#Any#,45
Before Change
)
base_ring.setup(self.hass, VALID_CONFIG)
ring.setup_platform(self.hass, self.config, self.add_entities, None)
for device in self.DEVICES:
device.update()
if device.name == "Front Door Ding":
After Change
self.cleanup()
@requests_mock.Mocker()
def test_binary_sensor(self, mock):
Test the Ring sensor class and methods.
mock.post(
"https://oauth.ring.com/oauth/token", text=load_fixture("ring_oauth.json")
)
mock.post(
"https://api.ring.com/clients_api/session",
text=load_fixture("ring_session.json"),
)
mock.get(
"https://api.ring.com/clients_api/ring_devices",
text=load_fixture("ring_devices.json"),
)
mock.get(
"https://api.ring.com/clients_api/dings/active",
text=load_fixture("ring_ding_active.json"),
)
mock.get(
"https://api.ring.com/clients_api/doorbots/987652/health",
text=load_fixture("ring_doorboot_health_attrs.json"),
)
mock.get(
"https://api.ring.com/clients_api/chimes/999999/health",
text=load_fixture("ring_chime_health_attrs.json"),
)
with mock_storage(), patch("homeassistant.components.ring.PLATFORMS", []):
run_coroutine_threadsafe(
base_ring.async_setup(self.hass, VALID_CONFIG), self.hass.loop
).result()
run_coroutine_threadsafe(
self.hass.async_block_till_done(), self.hass.loop
).result()
run_coroutine_threadsafe(
ring.async_setup_entry(self.hass, None, self.add_entities),
self.hass.loop,
).result()
for device in self.DEVICES:
device.update()
if device.name == "Front Door Ding":
assert "on" == device.state
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 22
Instances
Project Name: home-assistant/home-assistant
Commit Name: 3f29c234b8b2cae1c754bf55cdb2f283f8a62701
Time: 2020-01-10
Author: balloob@gmail.com
File Name: tests/components/ring/test_binary_sensor.py
Class Name: TestRingBinarySensorSetup
Method Name: test_binary_sensor
Project Name: home-assistant/home-assistant
Commit Name: 0b3b589457110f1b2671298c80fa31ff948f91b0
Time: 2020-01-10
Author: balloob@gmail.com
File Name: tests/components/ring/test_sensor.py
Class Name: TestRingSensorSetup
Method Name: test_sensor
Project Name: home-assistant/home-assistant
Commit Name: 0b3b589457110f1b2671298c80fa31ff948f91b0
Time: 2020-01-10
Author: balloob@gmail.com
File Name: tests/components/ring/test_binary_sensor.py
Class Name: TestRingBinarySensorSetup
Method Name: test_binary_sensor
Project Name: home-assistant/home-assistant
Commit Name: 3f29c234b8b2cae1c754bf55cdb2f283f8a62701
Time: 2020-01-10
Author: balloob@gmail.com
File Name: tests/components/ring/test_sensor.py
Class Name: TestRingSensorSetup
Method Name: test_sensor
Project Name: home-assistant/home-assistant
Commit Name: 3f29c234b8b2cae1c754bf55cdb2f283f8a62701
Time: 2020-01-10
Author: balloob@gmail.com
File Name: tests/components/ring/test_binary_sensor.py
Class Name: TestRingBinarySensorSetup
Method Name: test_binary_sensor