DRYer
This commit is contained in:
parent
b0b8b06b56
commit
fdf055312c
1 changed files with 7 additions and 5 deletions
|
|
@ -73,6 +73,9 @@ def multi_click(x=0, y=0, count=2):
|
|||
count -= 1
|
||||
ev(GLFW_MOUSE_BUTTON_LEFT, x=x, y=y)
|
||||
|
||||
def scroll(x=0, y=0, up=True):
|
||||
move(x=x, y=y, button=-2 if up else -3)
|
||||
|
||||
# Simple, click, move, release test
|
||||
init()
|
||||
press()
|
||||
|
|
@ -131,15 +134,14 @@ def multi_click(x=0, y=0, count=2):
|
|||
release()
|
||||
|
||||
# scrolling
|
||||
UP, DOWN = -2, -3
|
||||
init()
|
||||
press(x=1)
|
||||
move(x=1, button=UP)
|
||||
scroll(x=1)
|
||||
self.ae(sel(), 'LMNO12')
|
||||
move(x=1, button=UP)
|
||||
scroll(x=1)
|
||||
self.ae(sel(), 'GHIJKLMNO12')
|
||||
move(x=1, button=DOWN)
|
||||
scroll(x=1, up=False)
|
||||
self.ae(sel(), 'LMNO12')
|
||||
move(x=2, button=DOWN)
|
||||
scroll(x=2, up=False)
|
||||
self.ae(sel(), '23')
|
||||
release()
|
||||
|
|
|
|||
Loading…
Reference in a new issue