mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-02 08:12:47 +01:00
Deprecate advanced mode option in addon config (#6614)
* Deprecate advanced mode option in addon config * Note deprecation of field in addon info and list APIs * Update docstring per copilot
This commit is contained in:
@@ -18,7 +18,7 @@ from supervisor.addons.addon import Addon
|
||||
from supervisor.addons.const import AddonBackupMode
|
||||
from supervisor.addons.model import AddonModel
|
||||
from supervisor.config import CoreConfig
|
||||
from supervisor.const import AddonBoot, AddonState, BusEvent
|
||||
from supervisor.const import ATTR_ADVANCED, AddonBoot, AddonState, BusEvent
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.docker.addon import DockerAddon
|
||||
from supervisor.docker.const import ContainerState
|
||||
@@ -834,6 +834,14 @@ def test_auto_update_available(install_addon_example: Addon):
|
||||
assert install_addon_example.auto_update_available is False
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("coresys")
|
||||
def test_advanced_flag_ignored(install_addon_example: Addon):
|
||||
"""Ensure advanced flag in config is ignored."""
|
||||
install_addon_example.data[ATTR_ADVANCED] = True
|
||||
|
||||
assert install_addon_example.advanced is False
|
||||
|
||||
|
||||
async def test_paths_cache(coresys: CoreSys, install_addon_ssh: Addon):
|
||||
"""Test cache for key paths that may or may not exist."""
|
||||
assert not install_addon_ssh.with_logo
|
||||
|
||||
@@ -223,6 +223,16 @@ def test_warn_legacy_machine_values(caplog: pytest.LogCaptureFixture):
|
||||
assert "Add-on config 'machine' uses deprecated values" in caplog.text
|
||||
|
||||
|
||||
def test_warn_advanced_deprecated(caplog: pytest.LogCaptureFixture):
|
||||
"""Warn when deprecated advanced field is present."""
|
||||
config = load_json_fixture("basic-addon-config.json")
|
||||
config["advanced"] = True
|
||||
|
||||
vd.SCHEMA_ADDON_CONFIG(config)
|
||||
|
||||
assert "uses deprecated 'advanced' field in config" in caplog.text
|
||||
|
||||
|
||||
async def test_valid_manifest_build():
|
||||
"""Validate build config with manifest build from."""
|
||||
config = load_json_fixture("build-config-manifest.json")
|
||||
|
||||
Reference in New Issue
Block a user