Skip to content

Commit

Permalink
Add coverage for calling doorbird webhook with the wrong token (home-…
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jul 28, 2024
1 parent d4aa981 commit ba266ab
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/components/doorbird/test_view.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ba266ab

Please sign in to comment.