def test_loadunload(self): m = Matcher() # could be in setUp() but m shorter than self.m self.assertTrue(m.loadImage("../img/homescreen.png")) self.assertTrue(m.loadImage("../img/appgrid.png")) self.assertTrue(m.loadImage("../img/virtualkeyb_lowercase.png")) result = m.match("../img/homescreen.png", "../img/icon_appgrid.png", 100, "FEATURE") #printresult(result) m.unloadImage("../img/homescreen.png") m.unloadImage("../img/appgrid.png") m.unloadImage("../img/virtualkeyb_lowercase.png")
def test_locate_characters(self): m = Matcher() self.assertTrue(m.loadImage("../img/virtualkeyb_lowercase.png")) chars = "qwertyuiopasdfghjklzxcvbnm" bbox = m.match(icon="../img/keyboardarea.png").bbox[0] result = m.locateCharacters(characters=chars, searcharea=bbox) self.assertTrue(result.result[0] == 100)
def test_load_before_matching(self): m = Matcher() self.assertTrue(m.loadImage("../img/homescreen.png")) result = m.match(icon="../img/icon_appgrid.png") self.assertTrue(result.result[0] == 51)