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:
parent
aad6a24f28
commit
ad1a71ebc3
1 changed files with 4 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue