mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Yoda assertion style removed is (#48142)
This commit is contained in:
@@ -47,10 +47,10 @@ async def test_allowed_sender(hass):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
assert "Test" == sensor.state
|
||||
assert "Test Message" == sensor.extra_state_attributes["body"]
|
||||
assert "sender@test.com" == sensor.extra_state_attributes["from"]
|
||||
assert "Test" == sensor.extra_state_attributes["subject"]
|
||||
assert sensor.state == "Test"
|
||||
assert sensor.extra_state_attributes["body"] == "Test Message"
|
||||
assert sensor.extra_state_attributes["from"] == "sender@test.com"
|
||||
assert sensor.extra_state_attributes["subject"] == "Test"
|
||||
assert (
|
||||
datetime.datetime(2016, 1, 1, 12, 44, 57)
|
||||
== sensor.extra_state_attributes["date"]
|
||||
@@ -83,8 +83,8 @@ async def test_multi_part_with_text(hass):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
assert "Link" == sensor.state
|
||||
assert "Test Message" == sensor.extra_state_attributes["body"]
|
||||
assert sensor.state == "Link"
|
||||
assert sensor.extra_state_attributes["body"] == "Test Message"
|
||||
|
||||
|
||||
async def test_multi_part_only_html(hass):
|
||||
@@ -110,10 +110,10 @@ async def test_multi_part_only_html(hass):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
assert "Link" == sensor.state
|
||||
assert sensor.state == "Link"
|
||||
assert (
|
||||
"<html><head></head><body>Test Message</body></html>"
|
||||
== sensor.extra_state_attributes["body"]
|
||||
sensor.extra_state_attributes["body"]
|
||||
== "<html><head></head><body>Test Message</body></html>"
|
||||
)
|
||||
|
||||
|
||||
@@ -140,8 +140,8 @@ async def test_multi_part_only_other_text(hass):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
assert "Link" == sensor.state
|
||||
assert "Test Message" == sensor.extra_state_attributes["body"]
|
||||
assert sensor.state == "Link"
|
||||
assert sensor.extra_state_attributes["body"] == "Test Message"
|
||||
|
||||
|
||||
async def test_multiple_emails(hass):
|
||||
@@ -180,10 +180,10 @@ async def test_multiple_emails(hass):
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert "Test" == states[0].state
|
||||
assert "Test 2" == states[1].state
|
||||
assert states[0].state == "Test"
|
||||
assert states[1].state == "Test 2"
|
||||
|
||||
assert "Test Message 2" == sensor.extra_state_attributes["body"]
|
||||
assert sensor.extra_state_attributes["body"] == "Test Message 2"
|
||||
|
||||
|
||||
async def test_sender_not_allowed(hass):
|
||||
@@ -227,4 +227,4 @@ async def test_template(hass):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.async_schedule_update_ha_state(True)
|
||||
await hass.async_block_till_done()
|
||||
assert "Test from sender@test.com with message Test Message" == sensor.state
|
||||
assert sensor.state == "Test from sender@test.com with message Test Message"
|
||||
|
||||
Reference in New Issue
Block a user