def test_verticalCenteredLoops(self): for imgpath in self.verticalCenteredLoopsGrp: res = lucid.find_loop_byimg_testlauncher(imgpath) self.assertTrue(((res[2][0] == "Coord") or (res[2][0] == "ApproxCoord"))) self.assertTrue( ((res[2][1] > ((res[0] // 2) - (res[0] // 8))) and (res[2][1] < (res[0] // 2) + (res[0] // 8))) )
def test_horizontalCenteredLoops(self): for imgpath in self.horizontalCenteredLoopsGrp: res = lucid.find_loop_byimg_testlauncher(imgpath) self.assertEqual(res[2][0], "Coord") self.assertTrue( ((res[2][2] > ((res[1] // 2) - (res[1] // 8))) and (res[2][2] < (res[1] // 2) + (res[1] // 8))) )
def test_horizontalUpLoops(self): for imgpath in self.horizontalUpLoopsGrp: res = lucid.find_loop_byimg_testlauncher(imgpath) self.assertTrue(((res[2][0] == "Coord") or (res[2][0] == "ApproxCoord"))) self.assertTrue((res[2][2] < ((res[1] // 2) - (res[1] // 8))))
def test_robotArm(self): for imgpath in self.robotArmGrp: res = lucid.find_loop_byimg_testlauncher(imgpath) self.assertEqual(res[2][0], "ArmRobot") self.assertEqual(res[2][1], res[0])
def test_noLoops(self): for imgpath in self.noLoopsGrp: res = lucid.find_loop_byimg_testlauncher(imgpath) self.assertEqual(res[2], ("No loop detected", -1, -1))