Adjust tests for removing github devices (#64448)
This commit is contained in:
parent
9facd3962c
commit
554e51017e
4 changed files with 72 additions and 41 deletions
|
@ -10,12 +10,10 @@ from homeassistant.components.github.const import (
|
|||
DEFAULT_REPOSITORIES,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .common import MOCK_ACCESS_TOKEN
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -34,28 +32,3 @@ 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 setup_github_integration(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
) -> Generator[None, None, None]:
|
||||
"""Mock setting up the integration."""
|
||||
aioclient_mock.get(
|
||||
"https://api.github.com/repos/home-assistant/core",
|
||||
json={},
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
for endpoint in ("issues", "pulls", "releases", "commits"):
|
||||
aioclient_mock.get(
|
||||
f"https://api.github.com/repos/home-assistant/core/{endpoint}",
|
||||
json=[],
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
mock_config_entry.options = {CONF_REPOSITORIES: ["home-assistant/core"]}
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
|
||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue