mirror of
https://github.com/ankitects/anki.git
synced 2026-06-10 17:50:13 -04:00
This just limits the fix added in
469fd763c7
to the launcher so it has no effect on Briefcase builds. It looks
harmless, but just in case it does cause subtle issues.
---------
Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com>
28 lines
838 B
Python
28 lines
838 B
Python
# Copyright: Ankitects Pty Ltd and contributors
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import os
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.skipif(sys.platform != "win32", reason="windows taskbar test")
|
|
@pytest.mark.parametrize("is_launcher", [False, True])
|
|
def test_app_user_model_id_set(monkeypatch, is_launcher: bool) -> None:
|
|
from pywintypes import com_error
|
|
from win32com.shell import shell
|
|
|
|
from aqt.package import _fix_win_taskbar_pinning
|
|
|
|
if is_launcher:
|
|
monkeypatch.setenv("ANKI_LAUNCHER", "testpath")
|
|
_fix_win_taskbar_pinning()
|
|
|
|
assert shell.GetCurrentProcessExplicitAppUserModelID() == "Ankitects.Anki"
|
|
else:
|
|
_fix_win_taskbar_pinning()
|
|
|
|
with pytest.raises(com_error):
|
|
shell.GetCurrentProcessExplicitAppUserModelID()
|