Make get_channel available as generic helper (#101721)
* Make get_channel available as generic helper * Follow up comment
This commit is contained in:
parent
915f5bf84e
commit
31bd500222
4 changed files with 43 additions and 29 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue