mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Collection of random (mainly) test improvements (#33733)
This commit is contained in:
@@ -103,19 +103,19 @@ async def test_set_value(hass):
|
||||
entity_id = "input_text.test_1"
|
||||
|
||||
state = hass.states.get(entity_id)
|
||||
assert "test" == str(state.state)
|
||||
assert str(state.state) == "test"
|
||||
|
||||
set_value(hass, entity_id, "testing")
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get(entity_id)
|
||||
assert "testing" == str(state.state)
|
||||
assert str(state.state) == "testing"
|
||||
|
||||
set_value(hass, entity_id, "testing too long")
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get(entity_id)
|
||||
assert "testing" == str(state.state)
|
||||
assert str(state.state) == "testing"
|
||||
|
||||
|
||||
async def test_mode(hass):
|
||||
@@ -144,15 +144,15 @@ async def test_mode(hass):
|
||||
|
||||
state = hass.states.get("input_text.test_default_text")
|
||||
assert state
|
||||
assert "text" == state.attributes["mode"]
|
||||
assert state.attributes["mode"] == "text"
|
||||
|
||||
state = hass.states.get("input_text.test_explicit_text")
|
||||
assert state
|
||||
assert "text" == state.attributes["mode"]
|
||||
assert state.attributes["mode"] == "text"
|
||||
|
||||
state = hass.states.get("input_text.test_explicit_password")
|
||||
assert state
|
||||
assert "password" == state.attributes["mode"]
|
||||
assert state.attributes["mode"] == "password"
|
||||
|
||||
|
||||
async def test_restore_state(hass):
|
||||
@@ -273,8 +273,8 @@ async def test_reload(hass, hass_admin_user, hass_read_only_user):
|
||||
assert state_1 is not None
|
||||
assert state_2 is not None
|
||||
assert state_3 is None
|
||||
assert "test 1" == state_1.state
|
||||
assert "test 2" == state_2.state
|
||||
assert state_1.state == "test 1"
|
||||
assert state_2.state == "test 2"
|
||||
assert state_1.attributes[ATTR_MIN] == 0
|
||||
assert state_2.attributes[ATTR_MAX] == 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user