Revamp github integration (#64190)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Co-authored-by: Franck Nijhof <git@frenck.dev> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
37caa22a36
commit
6a0c3843e5
16 changed files with 1113 additions and 246 deletions
34
tests/components/github/conftest.py
Normal file
34
tests/components/github/conftest.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
"""conftest for the GitHub integration."""
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.github.const import (
|
||||
CONF_ACCESS_TOKEN,
|
||||
CONF_REPOSITORIES,
|
||||
DEFAULT_REPOSITORIES,
|
||||
DOMAIN,
|
||||
)
|
||||
|
||||
from .common import MOCK_ACCESS_TOKEN
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry() -> MockConfigEntry:
|
||||
"""Return the default mocked config entry."""
|
||||
return MockConfigEntry(
|
||||
title="",
|
||||
domain=DOMAIN,
|
||||
data={CONF_ACCESS_TOKEN: MOCK_ACCESS_TOKEN},
|
||||
options={CONF_REPOSITORIES: DEFAULT_REPOSITORIES},
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue