File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 11"""Test Supervisor API."""
22
33# pylint: disable=protected-access
4- from unittest .mock import AsyncMock
4+ from unittest .mock import AsyncMock , patch
5+
6+ from aiohttp .test_utils import TestClient
57
68from supervisor .api .const import ATTR_AVAILABLE_UPDATES
9+ from supervisor .const import UpdateChannel
710from supervisor .coresys import CoreSys
811
912from tests .const import TEST_ADDON_SLUG
@@ -78,3 +81,19 @@ async def test_api_refresh_updates(api_client, coresys: CoreSys):
7881
7982 assert coresys .updater .reload .called
8083 assert coresys .store .reload .called
84+
85+
86+ async def test_api_reload_updates (
87+ coresys : CoreSys ,
88+ api_client : TestClient ,
89+ ):
90+ """Test reload updates."""
91+ coresys .updater .channel = UpdateChannel .STABLE
92+ with (
93+ patch ("supervisor.updater.Updater.fetch_data" ) as fetch_data ,
94+ ):
95+ resp = await api_client .post ("/reload_updates" )
96+
97+ fetch_data .assert_called_once_with ()
98+
99+ assert resp .status == 200
You can’t perform that action at this time.
0 commit comments