Skip to content

Commit

Permalink
HA core version sync for test env
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-or committed Nov 5, 2024
1 parent e1bdea5 commit 12b28da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requests-toolbelt==1.0.0
pytest
pytest-asyncio
pytest-cov>=4.1.0
pytest-homeassistant-custom-component
pytest-homeassistant-custom-component>=0.13.179

#
async-timeout
Expand Down
12 changes: 6 additions & 6 deletions tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import httpx
from homeassistant.core import HomeAssistant
from homeassistant.const import STATE_IDLE
from homeassistant.components import camera as camera_component
from homeassistant.components.camera.helper import get_camera_from_entity_id
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from pytest_homeassistant_custom_component.common import MockConfigEntry
from tests.conftest import load_fixture
Expand All @@ -22,7 +22,7 @@ async def test_camera(hass: HomeAssistant, init_integration: MockConfigEntry) ->
entity_id = "camera.ds_7608nxi_i0_0p_s0000000000ccrrj00000000wcvu_101"
assert hass.states.get(entity_id)

camera_entity = camera_component._get_camera_from_entity_id(hass, entity_id)
camera_entity = get_camera_from_entity_id(hass, entity_id)
assert camera_entity.state == STATE_IDLE
assert camera_entity.name == "garden"

Expand All @@ -47,7 +47,7 @@ async def test_camera_snapshot(hass: HomeAssistant, init_integration: MockConfig
"""Test camera snapshot."""

entity_id = "camera.ds_7608nxi_i0_0p_s0000000000ccrrj00000000wcvu_101"
camera_entity = camera_component._get_camera_from_entity_id(hass, entity_id)
camera_entity = get_camera_from_entity_id(hass, entity_id)

image_url = f"{TEST_HOST}/ISAPI/Streaming/channels/101/picture"
respx.get(image_url).respond(content=b"binary image data")
Expand All @@ -61,7 +61,7 @@ async def test_camera_snapshot_device_error(hass: HomeAssistant, init_integratio
"""Test camera snapshot with 2 attempts."""

entity_id = "camera.ds_7608nxi_i0_0p_s0000000000ccrrj00000000wcvu_101"
camera_entity = camera_component._get_camera_from_entity_id(hass, entity_id)
camera_entity = get_camera_from_entity_id(hass, entity_id)

image_url = f"{TEST_HOST}/ISAPI/Streaming/channels/101/picture"
route = respx.get(image_url)
Expand All @@ -81,7 +81,7 @@ async def test_camera_snapshot_alternate_url(hass: HomeAssistant, init_integrati
"""Test camera snapshot with alternate url."""

entity_id = "camera.ds_7616ni_q2_00p0000000000ccrre00000000wcvu_101"
camera_entity = camera_component._get_camera_from_entity_id(hass, entity_id)
camera_entity = get_camera_from_entity_id(hass, entity_id)

error_response = load_fixture("ISAPI/Streaming.channels.x0y.picture", "badXmlContent")
image_url = f"{TEST_HOST}/ISAPI/Streaming/channels/101/picture"
Expand Down Expand Up @@ -116,7 +116,7 @@ async def test_camera_stream_info(hass: HomeAssistant, init_integration: MockCon

data = device_data[init_integration.title]
entity_id = data["entity_id"]
camera_entity = camera_component._get_camera_from_entity_id(hass, entity_id)
camera_entity = get_camera_from_entity_id(hass, entity_id)

assert camera_entity.stream_info.codec == data["codec"]
assert camera_entity.stream_info.width == data["width"]
Expand Down

0 comments on commit 12b28da

Please sign in to comment.