def testOneCalibPoint(self):
        tobii_helper = calibrator.TobiiHelper()
        tobii_helper.disableLogging()
        tobii_helper.setMonitor()
        
        calibration_point0 = tobii.CalibrationPoint((0.0, 0.0),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.0, 0.0), True),
                                                            tobii.CalibrationEyeData((0.0, 0.0), True)),))
        calibration_point = tobii.CalibrationPoint((0.1, 0.1),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.08, 0.08), True),
                                                            tobii.CalibrationEyeData((0.09, 0.08), True)),))
        calibration_points = (calibration_point0, calibration_point)
        calibResult = tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)                                                               
        calibData = tobii_helper._TobiiHelper__calculateCalibration(calibResult)
        self.assertEqual(1, len(calibData))
        self.assertEqual(4, len(calibData[0]))

        # (0.1,0.1)
        # average sample point
        self.assertEqual(-546, calibData[0][0][0])
        self.assertEqual(307, calibData[0][0][1])
        # average left eye sample point
        self.assertEqual(-573, calibData[0][1][0])
        self.assertEqual(322, calibData[0][1][1])
        # average right eye sample point
        self.assertEqual(-560, calibData[0][2][0])
        self.assertEqual(322, calibData[0][2][1])
    def testInvalidSamplePoints(self):
        tobii_helper = calibrator.TobiiHelper()
        tobii_helper.disableLogging()
        tobii_helper.setMonitor()

        calibration_point0 = tobii.CalibrationPoint((0.0, 0.0),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.0, 0.0), True),
                                                            tobii.CalibrationEyeData((0.0, 0.0), True)),))
        calibration_point = tobii.CalibrationPoint((0.1, 0.1),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((-0.5, -0.5), True),
                                                            tobii.CalibrationEyeData((-0.5, -0.5), True)),))
        calibration_point2 = tobii.CalibrationPoint((0.9, 0.9),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.98, 0.98), True),
                                                            tobii.CalibrationEyeData((0.99, 0.98), True)),))

        calibration_points = (calibration_point0, calibration_point, calibration_point2)
        calibResult = tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)
        with self.assertRaises(ValueError):
            calibData = tobii_helper._TobiiHelper__calculateCalibration(calibResult)
 def initCalibPoints(self):
     calibration_point0 = tobii.CalibrationPoint((0.0, 0.0),(
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.0, 0.0), True),
                                                         tobii.CalibrationEyeData((0.0, 0.0), True)),))
     calibration_point = tobii.CalibrationPoint((0.1, 0.1),(
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.08, 0.08), True),
                                                         tobii.CalibrationEyeData((0.09, 0.08), True)),
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.12, 0.11), True),
                                                         tobii.CalibrationEyeData((0.18, 0.12), True)),
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.11, 0.12), True),
                                                         tobii.CalibrationEyeData((0.10, 0.10), True))))
     calibration_point2 = tobii.CalibrationPoint((0.9, 0.9),(
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.98, 0.98), True),
                                                         tobii.CalibrationEyeData((0.99, 0.98), True)),
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.91, 0.90), True),
                                                         tobii.CalibrationEyeData((0.90, 0.97), True)),
                                 tobii.CalibrationSample(tobii.CalibrationEyeData((0.89, 0.87), True),
                                                         tobii.CalibrationEyeData((0.98, 0.99), True))))
     calibration_points = (calibration_point0, calibration_point, calibration_point2)
     return tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)
Ejemplo n.º 4
0
    def compute_and_apply(self):
        calibration_result_list = []
        for point in self.collection_points:
            calibration_result_list.append(
                tobii.CalibrationPoint(
                    (point[0], point[1]), (tobii.CalibrationSample(
                        tobii.CalibrationEyeData(
                            (point[0] + 0.02, point[1] + 0.02), True),
                        tobii.CalibrationEyeData(
                            (point[0] - 0.02, point[1] - 0.02), True)), )))

        return tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS,
                                       tuple(calibration_result_list))
    def testFiveCalibPoints(self):
        tobii_helper = calibrator.TobiiHelper()
        tobii_helper.disableLogging()
        tobii_helper.setMonitor()
        
        calibration_point0 = tobii.CalibrationPoint((0.0, 0.0),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.0, 0.0), True),
                                                            tobii.CalibrationEyeData((0.0, 0.0), True)),))
        calibration_point = tobii.CalibrationPoint((0.1, 0.1),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.08, 0.08), True),
                                                            tobii.CalibrationEyeData((0.09, 0.08), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.12, 0.11), True),
                                                            tobii.CalibrationEyeData((0.18, 0.12), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.11, 0.12), True),
                                                            tobii.CalibrationEyeData((0.10, 0.10), True))))
        calibration_point2 = tobii.CalibrationPoint((0.9, 0.1),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.98, 0.08), True),
                                                            tobii.CalibrationEyeData((0.99, 0.09), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.91, 0.12), True),
                                                            tobii.CalibrationEyeData((0.90, 0.11), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.89, 0.13), True),
                                                            tobii.CalibrationEyeData((0.98, 0.09), True))))
        calibration_point3 = tobii.CalibrationPoint((0.5, 0.5),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.51, 0.51), True),
                                                            tobii.CalibrationEyeData((0.53, 0.45), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.43, 0.48), True),
                                                            tobii.CalibrationEyeData((0.49, 0.49), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.50, 0.53), True),
                                                            tobii.CalibrationEyeData((0.49, 0.54), True))))
        calibration_point4 = tobii.CalibrationPoint((0.1, 0.9),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.08, 0.98), True),
                                                            tobii.CalibrationEyeData((0.09, 0.8), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.12, 0.91), True),
                                                            tobii.CalibrationEyeData((0.18, 0.92), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.11, 0.92), True),
                                                            tobii.CalibrationEyeData((0.10, 0.90), True))))
        calibration_point5 = tobii.CalibrationPoint((0.9, 0.9),(
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.98, 0.98), True),
                                                            tobii.CalibrationEyeData((0.99, 0.98), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.92, 0.91), True),
                                                            tobii.CalibrationEyeData((0.98, 0.92), True)),
                                    tobii.CalibrationSample(tobii.CalibrationEyeData((0.91, 0.92), True),
                                                            tobii.CalibrationEyeData((0.90, 0.90), True))))
        calibration_points = (calibration_point0, calibration_point, calibration_point2,
                              calibration_point3, calibration_point4, calibration_point5)
        calibResult = tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)                                                               
        calibData = tobii_helper._TobiiHelper__calculateCalibration(calibResult)
        self.assertEqual(5, len(calibData))
        self.assertEqual(4, len(calibData[0]))
        self.assertEqual(4, len(calibData[1]))
        self.assertEqual(4, len(calibData[2]))
        self.assertEqual(4, len(calibData[3]))
        self.assertEqual(4, len(calibData[4]))

        # (0.1,0.1)
        # average sample point
        self.assertEqual(-546, calibData[0][0][0])
        self.assertEqual(307, calibData[0][0][1])
        # average left eye sample point
        self.assertEqual(-541, calibData[0][1][0])
        self.assertEqual(304, calibData[0][1][1])
        # average right eye sample point
        self.assertEqual(-514, calibData[0][2][0])
        self.assertEqual(307, calibData[0][2][1])

        # (0.9,0.1)
        # average sample point
        self.assertEqual(546, calibData[1][0][0])
        self.assertEqual(307, calibData[1][0][1])
        # average left eye sample point
        self.assertEqual(582, calibData[1][1][0])
        self.assertEqual(299, calibData[1][1][1])
        # average right eye sample point
        self.assertEqual(623, calibData[1][2][0])
        self.assertEqual(309, calibData[1][2][1])

        # (0.5,0.5)
        # average sample point
        self.assertEqual(0, calibData[2][0][0])
        self.assertEqual(0, calibData[2][0][1])
        # average left eye sample point
        self.assertEqual(-27, calibData[2][1][0])
        self.assertEqual(-5, calibData[2][1][1])
        # average right eye sample point
        self.assertEqual(4, calibData[2][2][0])
        self.assertEqual(5, calibData[2][2][1])

        # (0.1,0.9)
        # average sample point
        self.assertEqual(-546, calibData[3][0][0])
        self.assertEqual(-307, calibData[3][0][1])
        # average left eye sample point
        self.assertEqual(-541, calibData[3][1][0])
        self.assertEqual(-335, calibData[3][1][1])
        # average right eye sample point
        self.assertEqual(-514, calibData[3][2][0])
        self.assertEqual(-286, calibData[3][2][1])

        # (0.9,0.9)
        # average sample point
        self.assertEqual(546, calibData[4][0][0])
        self.assertEqual(-307, calibData[4][0][1])
        # average left eye sample point
        self.assertEqual(596, calibData[4][1][0])
        self.assertEqual(-335, calibData[4][1][1])
        # average right eye sample point
        self.assertEqual(623, calibData[4][2][0])
        self.assertEqual(-332, calibData[4][2][1])        
Ejemplo n.º 6
0
    def testTwoCalibPointsWithoutNullItem(self):
        tobii_helper = calibrator.TobiiHelper()
        self.initAll(tobii_helper)

        calibration_point = tobii.CalibrationPoint(
            (0.1, 0.1), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.08, 0.08), True),
                tobii.CalibrationEyeData((0.09, 0.08), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.12, 0.11), True),
                             tobii.CalibrationEyeData((0.18, 0.12), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.11, 0.12), True),
                             tobii.CalibrationEyeData((0.10, 0.10), True))))
        calibration_point2 = tobii.CalibrationPoint(
            (0.9, 0.9), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.98, 0.98), True),
                tobii.CalibrationEyeData((0.99, 0.98), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.91, 0.90), True),
                             tobii.CalibrationEyeData((0.90, 0.97), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.89, 0.87), True),
                             tobii.CalibrationEyeData((0.98, 0.99), True))))
        calibration_points = (calibration_point, calibration_point2)
        self.calibResult = tobii.CalibrationResult(
            tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)

        pointList = [('1', (0.1, 0.1)), ('2', (0.9, 0.9))]
        self.calibDict = collections.OrderedDict(pointList)

        visual_mock = pvm.PsychoPyVisualMock()
        visual_mock.setReturnKeyList(['c'])
        tobii_helper._TobiiHelper__drawCalibrationResults(
            self.calibResult, self.calibWin, self.calibDict)
        drawing_list = visual_mock.getListOfDrawings()

        self.assertEqual(10, len(drawing_list))

        # first calib point's circle
        calibPoint1_circle = drawing_list[0]
        self.assertTrue(isinstance(calibPoint1_circle, pvm.Circle))
        # size
        self.assertEqual(50, calibPoint1_circle.radius)
        # pos
        self.assertEqual(-546, calibPoint1_circle.pos[0])
        self.assertEqual(307, calibPoint1_circle.pos[1])
        # color
        self.assertEqual([0.4, 0.4, 0.4],
                         calibPoint1_circle.fillColor.tolist())
        self.assertEqual([1.0, 1.0, 1.0],
                         calibPoint1_circle.lineColor.tolist())

        # first calib point's text
        calibPoint1_text = drawing_list[1]
        self.assertTrue(isinstance(calibPoint1_text, pvm.TextStim))
        # size
        self.assertEqual(60, calibPoint1_text.height)
        # pos
        self.assertEqual(-546, calibPoint1_text.pos[0])
        self.assertEqual(307, calibPoint1_text.pos[1])
        # color
        self.assertEqual([1.0, 1.0, 1.0], calibPoint1_text.color.tolist())
        # text
        self.assertEqual(str("1"), calibPoint1_text.text)

        # first calib point's left eye line
        calibPoint1_left_eye = drawing_list[2]
        self.assertTrue(isinstance(calibPoint1_left_eye, pvm.Line))
        # size
        self.assertEqual(20, calibPoint1_left_eye.lineWidth)
        # pos
        self.assertEqual(-546, calibPoint1_left_eye.start[0])
        self.assertEqual(307, calibPoint1_left_eye.start[1])
        self.assertEqual(-541, calibPoint1_left_eye.end[0])
        self.assertEqual(304, calibPoint1_left_eye.end[1])
        # color
        self.assertEqual("yellow", calibPoint1_left_eye.lineColor)

        # first calib point's right eye line
        calibPoint1_right_eye = drawing_list[3]
        self.assertTrue(isinstance(calibPoint1_right_eye, pvm.Line))
        # size
        self.assertEqual(20, calibPoint1_right_eye.lineWidth)
        # pos
        self.assertEqual(-546, calibPoint1_right_eye.start[0])
        self.assertEqual(307, calibPoint1_right_eye.start[1])
        self.assertEqual(-514, calibPoint1_right_eye.end[0])
        self.assertEqual(307, calibPoint1_right_eye.end[1])
        # color
        self.assertEqual("red", calibPoint1_right_eye.lineColor)

        # second calib point's circle
        calibPoint2_circle = drawing_list[4]
        self.assertTrue(isinstance(calibPoint2_circle, pvm.Circle))
        # size
        self.assertEqual(50, calibPoint2_circle.radius)
        # pos
        self.assertEqual(546, calibPoint2_circle.pos[0])
        self.assertEqual(-307, calibPoint2_circle.pos[1])
        # color
        self.assertEqual([0.4, 0.4, 0.4],
                         calibPoint2_circle.fillColor.tolist())
        self.assertEqual([1.0, 1.0, 1.0],
                         calibPoint2_circle.lineColor.tolist())

        # second calib point's text
        calibPoint2_text = drawing_list[5]
        self.assertTrue(isinstance(calibPoint2_text, pvm.TextStim))
        # size
        self.assertEqual(60, calibPoint2_text.height)
        # pos
        self.assertEqual(546, calibPoint2_text.pos[0])
        self.assertEqual(-307, calibPoint2_text.pos[1])
        # color
        self.assertEqual([1.0, 1.0, 1.0], calibPoint2_text.color.tolist())
        # text
        self.assertEqual(str("2"), calibPoint2_text.text)

        # second calib point's left eye line
        calibPoint2_left_eye = drawing_list[6]
        self.assertTrue(isinstance(calibPoint2_left_eye, pvm.Line))
        # size
        self.assertEqual(20, calibPoint2_left_eye.lineWidth)
        # pos
        self.assertEqual(546, calibPoint2_left_eye.start[0])
        self.assertEqual(-307, calibPoint2_left_eye.start[1])
        self.assertEqual(582, calibPoint2_left_eye.end[0])
        self.assertEqual(-320, calibPoint2_left_eye.end[1])
        # color
        self.assertEqual("yellow", calibPoint2_left_eye.lineColor)

        # second calib point's right eye line
        calibPoint2_right_eye = drawing_list[7]
        self.assertTrue(isinstance(calibPoint2_right_eye, pvm.Line))
        # size
        self.assertEqual(20, calibPoint2_right_eye.lineWidth)
        # pos
        self.assertEqual(546, calibPoint2_right_eye.start[0])
        self.assertEqual(-307, calibPoint2_right_eye.start[1])
        self.assertEqual(623, calibPoint2_right_eye.end[0])
        self.assertEqual(-368, calibPoint2_right_eye.end[1])
        # color
        self.assertEqual("red", calibPoint2_right_eye.lineColor)

        # text
        feedback_text = drawing_list[8]
        self.assertTrue(isinstance(feedback_text, pvm.TextStim))
        self.assertEqual(
            str("Wait for the experimenter. \nUse number keys to select points for recalibration."
                ), feedback_text.text)

        # text
        feedback_text = drawing_list[9]
        self.assertTrue(isinstance(feedback_text, pvm.TextStim))
        self.assertEqual(str("Finished checking. Resuming calibration."),
                         feedback_text.text)
Ejemplo n.º 7
0
    def initAll(self, tobii_helper):
        tobii_helper.calibration = DummyClass
        tobii_helper.disableLogging()
        tobii_helper.setMonitor()

        calibration_point0 = tobii.CalibrationPoint(
            (0.0, 0.0), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.0, 0.0), True),
                tobii.CalibrationEyeData((0.0, 0.0), True)), ))
        calibration_point = tobii.CalibrationPoint(
            (0.1, 0.1), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.08, 0.08), True),
                tobii.CalibrationEyeData((0.09, 0.08), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.12, 0.11), True),
                             tobii.CalibrationEyeData((0.18, 0.12), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.11, 0.12), True),
                             tobii.CalibrationEyeData((0.10, 0.10), True))))
        calibration_point2 = tobii.CalibrationPoint(
            (0.9, 0.1), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.98, 0.08), True),
                tobii.CalibrationEyeData((0.99, 0.09), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.91, 0.12), True),
                             tobii.CalibrationEyeData((0.90, 0.11), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.89, 0.13), True),
                             tobii.CalibrationEyeData((0.98, 0.09), True))))
        calibration_point3 = tobii.CalibrationPoint(
            (0.5, 0.5), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.51, 0.51), True),
                tobii.CalibrationEyeData((0.53, 0.45), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.43, 0.48), True),
                             tobii.CalibrationEyeData((0.49, 0.49), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.50, 0.53), True),
                             tobii.CalibrationEyeData((0.49, 0.54), True))))
        calibration_point4 = tobii.CalibrationPoint(
            (0.1, 0.9), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.08, 0.98), True),
                tobii.CalibrationEyeData((0.09, 0.8), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.12, 0.91), True),
                             tobii.CalibrationEyeData((0.18, 0.92), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.11, 0.92), True),
                             tobii.CalibrationEyeData((0.10, 0.90), True))))
        calibration_point5 = tobii.CalibrationPoint(
            (0.9, 0.9), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.98, 0.98), True),
                tobii.CalibrationEyeData((0.99, 0.98), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.92, 0.91), True),
                             tobii.CalibrationEyeData((0.98, 0.92), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.91, 0.92), True),
                             tobii.CalibrationEyeData((0.90, 0.90), True))))
        calibration_points = (calibration_point0, calibration_point,
                              calibration_point2, calibration_point3,
                              calibration_point4, calibration_point5)
        self.calibResult = tobii.CalibrationResult(
            tobii.CALIBRATION_STATUS_SUCCESS, calibration_points)
        self.calibWin = visual.Window(size=[1366, 768],
                                      pos=[0, 0],
                                      units='pix',
                                      fullscr=True,
                                      allowGUI=True,
                                      monitor=tobii_helper.win,
                                      winType='pyglet',
                                      color=[0.4, 0.4, 0.4])

        pointList = [('1', (0.1, 0.1)), ('2', (0.9, 0.1)), ('3', (0.5, 0.5)),
                     ('4', (0.1, 0.9)), ('5', (0.9, 0.9))]
        self.calibDict = collections.OrderedDict(pointList)
Ejemplo n.º 8
0
    def testNotInitedThingOrWrongParam(self):
        tobii_helper = calibrator.TobiiHelper()
        tobii_helper.disableLogging()
        tobii_helper.setMonitor()
        # no calibration
        with self.assertRaises(RuntimeError):
            tobii_helper._TobiiHelper__drawCalibrationResults(None, None, None)

        tobii_helper.calibration = "dummy"

        # no calibration results
        with self.assertRaises(TypeError):
            tobii_helper._TobiiHelper__drawCalibrationResults(None, None, None)

        calibration_point0 = tobii.CalibrationPoint(
            (0.0, 0.0), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.0, 0.0), True),
                tobii.CalibrationEyeData((0.0, 0.0), True)), ))
        calibration_point = tobii.CalibrationPoint(
            (0.1, 0.1), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.08, 0.08), True),
                tobii.CalibrationEyeData((0.09, 0.08), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.12, 0.11), True),
                             tobii.CalibrationEyeData((0.18, 0.12), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.11, 0.12), True),
                             tobii.CalibrationEyeData((0.10, 0.10), True))))
        calibration_point2 = tobii.CalibrationPoint(
            (0.9, 0.9), (tobii.CalibrationSample(
                tobii.CalibrationEyeData((0.98, 0.98), True),
                tobii.CalibrationEyeData((0.99, 0.98), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.91, 0.90), True),
                             tobii.CalibrationEyeData((0.90, 0.97), True)),
                         tobii.CalibrationSample(
                             tobii.CalibrationEyeData((0.89, 0.87), True),
                             tobii.CalibrationEyeData((0.98, 0.99), True))))
        calibration_points = (calibration_point0, calibration_point,
                              calibration_point2)
        calibResult = tobii.CalibrationResult(tobii.CALIBRATION_STATUS_SUCCESS,
                                              calibration_points)

        # no window
        with self.assertRaises(TypeError):
            tobii_helper._TobiiHelper__drawCalibrationResults(
                calibResult, None, None)

        with visual.Window(size=[1366, 768],
                           pos=[0, 0],
                           units='pix',
                           fullscr=True,
                           allowGUI=True,
                           monitor=tobii_helper.win,
                           winType='pyglet',
                           color=[0.4, 0.4, 0.4]) as calibWin:

            # no calib points
            with self.assertRaises(TypeError):
                tobii_helper._TobiiHelper__drawCalibrationResults(
                    calibResult, calibWin, None)

            pointList = [('1', (0.1, 0.1))]
            calibDict = collections.OrderedDict(pointList)

            # inconsitent data: calibDict has less items as calibResult
            with self.assertRaises(ValueError):
                tobii_helper._TobiiHelper__drawCalibrationResults(
                    calibResult, calibWin, calibDict)

            pointList = [('1', (0.1, 0.1)), ('2', (0.5, 0.5))]
            calibDict = collections.OrderedDict(pointList)

            # inconsitent data: calibDict has different items as calibResult
            with self.assertRaises(ValueError):
                tobii_helper._TobiiHelper__drawCalibrationResults(
                    calibResult, calibWin, calibDict)

            pointList = [('1', (0.1, 0.1)), ('2', (0.9, 0.9))]
            calibDict = collections.OrderedDict(pointList)

            # we are good now
            visual_mock = pvm.PsychoPyVisualMock()
            visual_mock.setReturnKeyList(['c'])
            tobii_helper._TobiiHelper__drawCalibrationResults(
                calibResult, calibWin, calibDict)

            calibWin.close()