Make get_channel available as generic helper (#101721)

* Make get_channel available as generic helper

* Follow up comment
This commit is contained in:
Jan Bouwhuis 2023-10-10 14:02:32 +02:00 committed by GitHub
parent 915f5bf84e
commit 31bd500222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 29 deletions

View file

@ -4,7 +4,7 @@ from unittest.mock import Mock, patch
import pytest
from homeassistant.components.sentry import get_channel, process_before_send
from homeassistant.components.sentry import process_before_send
from homeassistant.components.sentry.const import (
CONF_DSN,
CONF_ENVIRONMENT,
@ -103,20 +103,6 @@ async def test_setup_entry_with_tracing(hass: HomeAssistant) -> None:
assert call_args["traces_sample_rate"] == 0.5
@pytest.mark.parametrize(
("version", "channel"),
[
("0.115.0.dev20200815", "nightly"),
("0.115.0", "stable"),
("0.115.0b4", "beta"),
("0.115.0dev0", "dev"),
],
)
async def test_get_channel(version: str, channel: str) -> None:
"""Test if channel detection works from Home Assistant version number."""
assert get_channel(version) == channel
async def test_process_before_send(hass: HomeAssistant) -> None:
"""Test regular use of the Sentry process before sending function."""
hass.config.components.add("puppies")