def test_get_play_frame_at_play_time_with_poses_gives_end_frame(self): num_frames = 11 player = PosePlayer([POSE_1]*num_frames, FRAME_TIME) frame = player.get_play_frame(player.play_time_sec) self.assertEquals(frame, PlayFrame(num_frames-1, 0))
def test_get_play_frame_at_quarter_point_return_frame_and_offset(self): num_frames = 11 time_sec = FRAME_TIME * num_frames / 4.0 player = PosePlayer([POSE_1]*num_frames, FRAME_TIME) frame = player.get_play_frame(time_sec) self.assertEquals(frame, PlayFrame(2, 0.75))
def test_get_play_frame_at_zero_with_poses_gives_zero_frame(self): player = PosePlayer([POSE_1]*11, FRAME_TIME) frame = player.get_play_frame(0.0) self.assertEquals(frame, PLAY_FRAME_ZERO)