Skip to content

Commit

Permalink
add pixel_get_color test
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Jan 19, 2019
1 parent 406f115 commit c932623
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/unittests/test_screen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import sys
import os
from unittest import mock
import pytest
project_root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../..'))
sys.path.insert(0, project_root)
from ahk import AHK
Expand All @@ -10,8 +8,6 @@
from itertools import product
import time

import logging
logging.basicConfig(level=logging.DEBUG)

class TestScreen(TestCase):
def setUp(self):
Expand Down Expand Up @@ -42,3 +38,9 @@ def test_image_search(self):
self.im.save('testimage.png')
position = self.ahk.image_search('testimage.png')
self.assertIsNotNone(position)

def test_pixel_get_color(self):
x, y = self.ahk.pixel_search(0xFF0000)
result = self.ahk.pixel_get_color(x, y)
self.assertIsNotNone(result)
self.assertEqual(int(result, 16), 0xFF0000)

0 comments on commit c932623

Please sign in to comment.