Debian Codegraph @

tests/unit/test_toggle_vmenu_command.py

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 import importlib.util
2 from pathlib import Path
3 from unittest.mock import Mock
4
5 import pytest
6
7
8 COMMAND_PATH = (
9 Path(__file__).resolve().parents[2]
10 / "src"
11 / "fenrirscreenreader"
12 / "commands"
13 / "commands"
14 / "toggle_vmenu_mode.py"
15 )
16
17
18 def load_command():
19 spec = importlib.util.spec_from_file_location(
20 "fenrir_toggle_vmenu_mode", COMMAND_PATH
21 )
22 module = importlib.util.module_from_spec(spec)
23 spec.loader.exec_module(module)
24 return module.command()
25
26
27 @pytest.mark.unit
28 def test_get_description_does_not_toggle_vmenu_mode():
29 vmenu_manager = Mock()
30 command = load_command()
31 command.initialize({"runtime": {"VmenuManager": vmenu_manager}})
32
33 assert command.get_description() == "Entering or Leaving v menu mode."
34 vmenu_manager.toggle_vmenu_mode.assert_not_called()