mirror of
https://github.com/home-assistant/core.git
synced 2026-10-05 15:47:37 +01:00
Fix sql false warning (#67614)
This commit is contained in:
1 parent
5965b015dd
commit
3f9a6bbaa7
2 files changed
+7
-2
No files matched your search
@@ -115,7 +115,9 @@ async def test_query_limit(hass: HomeAssistant) -> None:
|
||||
assert state.attributes["value"] == 5
|
||||
|
||||
|
||||
async def test_query_no_value(hass: HomeAssistant) -> None:
|
||||
async def test_query_no_value(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Test the SQL sensor with a query that returns no value."""
|
||||
config = {
|
||||
"sensor": {
|
||||
@@ -137,6 +139,9 @@ async def test_query_no_value(hass: HomeAssistant) -> None:
|
||||
state = hass.states.get("sensor.count_tables")
|
||||
assert state.state == STATE_UNKNOWN
|
||||
|
||||
text = "SELECT 5 as value where 1=2 returned no results"
|
||||
assert text in caplog.text
|
||||
|
||||
|
||||
async def test_invalid_query(hass: HomeAssistant) -> None:
|
||||
"""Test the SQL sensor for invalid queries."""
|
||||
|
||||
Reference in new issue
Block a user