Fix test by add default args of port

This commit is contained in:
zhudhjen 2024-08-07 13:05:39 -07:00
parent c2174a6408
commit ca8d18552c

View file

@ -41,6 +41,7 @@ async def fixture_dashboard() -> DashboardTestHelper:
args = Mock(
ha_addon=True,
configuration=get_fixture_path("conf"),
port=0,
)
os.environ["ESPHOME_DASHBOARD_PORT"] = str(port)
DASHBOARD.settings.parse_args(args)
@ -52,7 +53,7 @@ async def fixture_dashboard() -> DashboardTestHelper:
assert DASHBOARD.settings.using_password is False
assert DASHBOARD.settings.on_ha_addon is True
assert DASHBOARD.settings.using_auth is False
assert DASHBOARD.settings.port is port
assert int(DASHBOARD.settings.port) == port
task = asyncio.create_task(DASHBOARD.async_run())
client = AsyncHTTPClient()
io_loop = IOLoop(make_current=False)