Skip to content

Commit

Permalink
add screen tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Aug 21, 2021
1 parent b3e889c commit cee2d15
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/unittests/test_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from PIL import Image
from itertools import product
import time

from ahk.daemon import AHKDaemon

class TestScreen(TestCase):
def setUp(self):
Expand Down Expand Up @@ -44,3 +44,19 @@ def test_pixel_get_color(self):
result = self.ahk.pixel_get_color(x, y)
self.assertIsNotNone(result)
self.assertEqual(int(result, 16), 0xFF0000)

class TestScreenDaemon(TestScreen):
def setUp(self):
self.ahk = AHKDaemon()
self.ahk.start()
self.before_windows = self.ahk.windows()
im = Image.new('RGB', (20, 20))
for coord in product(range(20), range(20)):
im.putpixel(coord, (255, 0, 0))
self.im = im
im.show()
time.sleep(2)

def tearDown(self):
super().tearDown()
self.ahk.stop()

0 comments on commit cee2d15

Please sign in to comment.