Skip to content

Commit

Permalink
test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sezanzeb committed Feb 2, 2025
1 parent b8050a8 commit 66a2319
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions tests/unit/test_event_pipeline/test_event_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
from inputremapper.injection.global_uinputs import GlobalUInputs, UInput
from inputremapper.injection.mapping_handlers.mapping_parser import MappingParser
from inputremapper.input_event import InputEvent
from tests.lib.cleanup import cleanup, clear_write_history
from tests.lib.cleanup import cleanup
from tests.lib.logger import logger
from tests.lib.constants import MAX_ABS, MIN_ABS
from tests.lib.fixtures import Fixture, fixtures
Expand Down Expand Up @@ -1424,7 +1424,10 @@ async def test_rel_to_abs(self):
)

async def test_rel_to_abs_reset_multiple(self):
# Recenters correctly when triggering the mapping a second time
# Recenters correctly when triggering the mapping a second time.
# It appears in order to really properly retrigger, a key-input is needed
# that can be released and pressed again.

# left mouse x to abs x
gain = 0.5
cutoff = 2
Expand Down Expand Up @@ -1453,14 +1456,8 @@ async def test_rel_to_abs_reset_multiple(self):
for _ in range(3):
next_time = self.next_usec_time()
value = int(REL_XY_SCALING * cutoff)
await self.send_events(
[
InputEvent(0, next_time, EV_KEY, KEY_A, 1),
InputEvent(0, next_time, EV_REL, REL_X, value),
],
event_reader,
)

await event_reader.handle(InputEvent(0, next_time, EV_KEY, KEY_A, 1))
await event_reader.handle(InputEvent(0, next_time, EV_REL, REL_X, value))
await asyncio.sleep(0.2)

history = self.global_uinputs.get_uinput("gamepad").write_history
Expand All @@ -1469,13 +1466,9 @@ async def test_rel_to_abs_reset_multiple(self):
history,
)

await self.send_events(
[InputEvent(0, next_time, EV_KEY, KEY_A, 0)],
event_reader,
)
await asyncio.sleep(0.2)
await event_reader.handle(InputEvent(0, next_time, EV_KEY, KEY_A, 0))
await asyncio.sleep(0.1)

clear_write_history()
self.global_uinputs.get_uinput("gamepad").write_history = []

async def test_rel_to_abs_with_input_switch(self):
Expand Down

0 comments on commit 66a2319

Please sign in to comment.