mirror of
https://github.com/home-assistant/core.git
synced 2025-08-19 10:20:07 +00:00
Use Etag in GitHub coordinator updates (#64449)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -7,13 +7,14 @@ import pytest
|
||||
from homeassistant.components.github.const import (
|
||||
CONF_ACCESS_TOKEN,
|
||||
CONF_REPOSITORIES,
|
||||
DEFAULT_REPOSITORIES,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .common import MOCK_ACCESS_TOKEN
|
||||
from .common import MOCK_ACCESS_TOKEN, TEST_REPOSITORY, setup_github_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -23,7 +24,7 @@ def mock_config_entry() -> MockConfigEntry:
|
||||
title="",
|
||||
domain=DOMAIN,
|
||||
data={CONF_ACCESS_TOKEN: MOCK_ACCESS_TOKEN},
|
||||
options={CONF_REPOSITORIES: DEFAULT_REPOSITORIES},
|
||||
options={CONF_REPOSITORIES: [TEST_REPOSITORY]},
|
||||
)
|
||||
|
||||
|
||||
@@ -32,3 +33,14 @@ def mock_setup_entry() -> Generator[None, None, None]:
|
||||
"""Mock setting up a config entry."""
|
||||
with patch("homeassistant.components.github.async_setup_entry", return_value=True):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def init_integration(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
) -> MockConfigEntry:
|
||||
"""Set up the GitHub integration for testing."""
|
||||
await setup_github_integration(hass, mock_config_entry, aioclient_mock)
|
||||
return mock_config_entry
|
||||
|
Reference in New Issue
Block a user