def test_has_custom_logo(monkeypatch, th: Theme, edition_short: str, with_logo: bool) -> None: monkeypatch.setattr("cmk.utils.version.edition_short", lambda: edition_short) if with_logo: th.base_dir().joinpath("images").mkdir(parents=True, exist_ok=True) th.base_dir().joinpath("images", "mk-logo.png").touch() assert th.has_custom_logo() is (edition_short == "cme" and with_logo)
def test_has_custom_logo(monkeypatch, th: Theme, edition: cmk.utils.version.Edition, with_logo: bool) -> None: monkeypatch.setattr("cmk.gui.utils.theme.is_managed_edition", lambda: edition is cmk.utils.version.Edition.CME) if with_logo: th.base_dir().joinpath("images").mkdir(parents=True, exist_ok=True) th.base_dir().joinpath("images", "mk-logo.png").touch() assert th.has_custom_logo() is (edition is cmk.utils.version.Edition.CME and with_logo)