def test_markerPos(self): s = Slider(self.win, size=(1, 0.1)) s._updateMarkerPos = False minPos, maxPos = 1, 5 assert s._updateMarkerPos != True s.markerPos = 1 assert s.markerPos == minPos s.markerPos = 5 assert s.markerPos == maxPos s.markerPos = 0 assert s.markerPos == minPos s.markerPos = 6 assert s.markerPos == maxPos assert s._updateMarkerPos == True
def test_reset(self): s = Slider(self.win, size=(1, 0.1)) s.markerPos = 1 s.history = [1] s.rating = 1 s.rt = 1 s.status = constants.STARTED s.reset() assert s.markerPos == None assert s.history == [] assert s.rating == None assert s.rt == None assert s.status == constants.NOT_STARTED