1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-25 04:46:25 +00:00

Add music assistant to the builtin repositories (#5128)

* Add music assistant to the builtin repositories

* Fix tests

* Fix tests some more

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Pascal Vizeli
2024-06-21 12:17:21 +02:00
committed by GitHub
parent ca7f3e8acb
commit c37b5effd7
5 changed files with 31 additions and 9 deletions

View File

@@ -39,11 +39,11 @@ async def test_default_load(coresys: CoreSys):
):
await store_manager.load()
assert len(store_manager.all) == 4
assert len(store_manager.all) == 5
assert isinstance(store_manager.get("core"), Repository)
assert isinstance(store_manager.get("local"), Repository)
assert len(store_manager.repository_urls) == 2
assert len(store_manager.repository_urls) == 3
assert (
"https://github.com/hassio-addons/repository" in store_manager.repository_urls
)
@@ -51,6 +51,11 @@ async def test_default_load(coresys: CoreSys):
"https://github.com/esphome/home-assistant-addon"
in store_manager.repository_urls
)
assert (
"https://github.com/music-assistant/home-assistant-addon"
in store_manager.repository_urls
)
# NOTE: When adding new stores, make sure to add it to tests/fixtures/addons/git/
assert refresh_cache_calls == {"local_ssh", "local_example", "core_samba"}
@@ -77,11 +82,11 @@ async def test_load_with_custom_repository(coresys: CoreSys):
):
await store_manager.load()
assert len(store_manager.all) == 5
assert len(store_manager.all) == 6
assert isinstance(store_manager.get("core"), Repository)
assert isinstance(store_manager.get("local"), Repository)
assert len(store_manager.repository_urls) == 3
assert len(store_manager.repository_urls) == 4
assert (
"https://github.com/hassio-addons/repository" in store_manager.repository_urls
)
@@ -89,6 +94,10 @@ async def test_load_with_custom_repository(coresys: CoreSys):
"https://github.com/esphome/home-assistant-addon"
in store_manager.repository_urls
)
assert (
"https://github.com/music-assistant/home-assistant-addon"
in store_manager.repository_urls
)
assert "http://example.com" in store_manager.repository_urls
@@ -105,11 +114,11 @@ async def test_load_from_core_config(coresys: CoreSys):
), patch("pathlib.Path.exists", return_value=True):
await coresys.store.load()
assert len(coresys.store.all) == 5
assert len(coresys.store.all) == 6
assert isinstance(coresys.store.get("core"), Repository)
assert isinstance(coresys.store.get("local"), Repository)
assert len(coresys.store.repository_urls) == 3
assert len(coresys.store.repository_urls) == 4
assert (
"https://github.com/hassio-addons/repository" in coresys.store.repository_urls
)
@@ -117,6 +126,10 @@ async def test_load_from_core_config(coresys: CoreSys):
"https://github.com/esphome/home-assistant-addon"
in coresys.store.repository_urls
)
assert (
"https://github.com/music-assistant/home-assistant-addon"
in coresys.store.repository_urls
)
assert "http://example.com" in coresys.store.repository_urls
assert coresys.config.addons_repositories == []
@@ -243,12 +256,12 @@ async def test_install_unavailable_addon(
async def test_reload(coresys: CoreSys):
"""Test store reload."""
await coresys.store.load()
assert len(coresys.store.all) == 4
assert len(coresys.store.all) == 5
with patch.object(GitRepo, "pull") as git_pull:
await coresys.store.reload()
assert git_pull.call_count == 3
assert git_pull.call_count == 4
async def test_addon_version_timestamp(coresys: CoreSys, install_addon_example: Addon):