Don't try to create /test dir in camera tests (#39914)

ERROR:homeassistant.components.camera:
Can't write image to file: [Errno 13] Permission denied: '/test'
This commit is contained in:
Ville Skyttä 2020-09-14 09:40:59 +03:00 committed by GitHub
parent aad6a24f28
commit ad1a71ebc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_START
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup import async_setup_component
from tests.async_mock import PropertyMock, mock_open, patch
from tests.async_mock import Mock, PropertyMock, mock_open, patch
from tests.components.camera import common
@ -114,8 +114,9 @@ async def test_snapshot_service(hass, mock_camera):
"""Test snapshot service."""
mopen = mock_open()
with patch(
"homeassistant.components.camera.open", mopen, create=True
with patch("homeassistant.components.camera.open", mopen, create=True), patch(
"homeassistant.components.camera.os.path.exists",
Mock(spec="os.path.exists", return_value=True),
), patch.object(hass.config, "is_allowed_path", return_value=True):
await hass.services.async_call(
camera.DOMAIN,