Skip to content

Commit

Permalink
simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Dec 3, 2023
1 parent 65f72ad commit 8c77778
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
File renamed without changes.
8 changes: 3 additions & 5 deletions tests/keyboard_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import tempfile
from zero_hid import Keyboard
from utils import random_file
from common import random_file

def test_typing():
path = random_file()
with open(path, 'ab+') as f:
with open(random_file(), 'ab+') as f:
k = Keyboard(f)
k.type("Hello world!")
f.seek(0)
Expand All @@ -16,8 +15,7 @@ def test_typing():


def test_release():
path = random_file()
with open(path, 'ab+') as f:
with open(random_file(), 'ab+') as f:
k = Keyboard(f)
k.release()
f.seek(0)
Expand Down
8 changes: 3 additions & 5 deletions tests/mouse_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import tempfile
from zero_hid import Mouse
from utils import random_file
from common import random_file

def test_left_click():
path = random_file()
with open(path, 'ab+') as f:
with open(random_file(), 'ab+') as f:
m = Mouse(f)
m.left_click()
f.seek(0)
Expand All @@ -14,8 +13,7 @@ def test_left_click():


def test_move():
path = random_file()
with open(path, 'ab+') as f:
with open(random_file(), 'ab+') as f:
m = Mouse(f)
m.move_relative(100, 100)
f.seek(0)
Expand Down

0 comments on commit 8c77778

Please sign in to comment.