refactor: convert hotkey module to package with evdev backend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import asyncio
|
||||
import sys
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from whisper_local.hotkey import HotkeyListener
|
||||
pytestmark = pytest.mark.skipif(sys.platform != "linux", reason="evdev only available on Linux")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def listener():
|
||||
return HotkeyListener(key_name="KEY_F12")
|
||||
from whisper_local.hotkey._evdev import EvdevHotkeyListener
|
||||
return EvdevHotkeyListener(key_name="KEY_F12")
|
||||
|
||||
|
||||
class TestHotkeyListener:
|
||||
@@ -33,6 +35,5 @@ class TestHotkeyListener:
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_no_callback_no_error(self, listener):
|
||||
# Kein Callback gesetzt — soll nicht crashen
|
||||
await listener._handle_key_event(key_down=True)
|
||||
await listener._handle_key_event(key_down=False)
|
||||
|
||||
Reference in New Issue
Block a user