mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Add coverage for calling doorbird webhook with the wrong token (#122700)
This commit is contained in:
parent
d4aa981fd7
commit
ba266ab13c
21
tests/components/doorbird/test_view.py
Normal file
21
tests/components/doorbird/test_view.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
"""Test DoorBird view."""
|
||||||
|
|
||||||
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
from homeassistant.components.doorbird.const import API_URL
|
||||||
|
|
||||||
|
from .conftest import DoorbirdMockerType
|
||||||
|
|
||||||
|
from tests.typing import ClientSessionGenerator
|
||||||
|
|
||||||
|
|
||||||
|
async def test_non_webhook_with_wrong_token(
|
||||||
|
hass_client: ClientSessionGenerator,
|
||||||
|
doorbird_mocker: DoorbirdMockerType,
|
||||||
|
) -> None:
|
||||||
|
"""Test calling the webhook with the wrong token."""
|
||||||
|
await doorbird_mocker()
|
||||||
|
client = await hass_client()
|
||||||
|
|
||||||
|
response = await client.get(f"{API_URL}/doorbell?token=wrong")
|
||||||
|
assert response.status == HTTPStatus.UNAUTHORIZED
|
Loading…
x
Reference in New Issue
Block a user