File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-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
79from supervisor .coresys import CoreSys
@@ -78,3 +80,18 @@ async def test_api_refresh_updates(api_client, coresys: CoreSys):
7880
7981 assert coresys .updater .reload .called
8082 assert coresys .store .reload .called
83+
84+
85+ async def test_api_reload_updates (
86+ coresys : CoreSys ,
87+ api_client : TestClient ,
88+ ):
89+ """Test reload updates."""
90+ with (
91+ patch ("supervisor.updater.Updater.fetch_data" ) as fetch_data ,
92+ ):
93+ resp = await api_client .post ("/reload_updates" )
94+
95+ fetch_data .assert_called_once_with ()
96+
97+ assert resp .status == 200
You can’t perform that action at this time.
0 commit comments