def setUp(self): self.interval_mock.reset_mock() action.set_testing(True) __builtin__.S = mock.MagicMock() __builtin__.render = mock.Mock() __builtin__.loader = mock.Mock() manager = mock.MagicMock() manager.map.__contains__ = mock.Mock(return_value=True) manager.npcs = {} self.char = char = Character(manager) char.actor = actor = mock.Mock() actor.getHpr = mock.Mock(return_value=(90, 30, 30)) self.anim_mock = mock.Mock() actor.getAnimControl.return_value = self.anim_mock char.speed = 1 char.hit_speed = 1 char.post_hit_speed = 2 char.hit_range = (4, 10) char.post_hit_range = (12, 18) S.ch_anim = {'walk_range': (100, 200)} char.idle_frame = 2323 char.pos = (3, 3)
def setUp(self, actor): self.interval_mock.reset_mock() action.set_testing(True) __builtin__.S = mock.MagicMock() __builtin__.render = mock.Mock() __builtin__.loader = mock.Mock() __builtin__.base = mock.Mock() __builtin__.camera = mock.Mock() manager = mock.Mock() manager.map.__contains__ = mock.Mock(return_value=True) manager.npcs = {} manager.bodies = {} self.pl = pl = Player(manager, (3, 3)) pl.actor.getHpr = mock.Mock(return_value=(45, 30, 30)) pl.actor.getAnimControl.return_value = self.anim_mock = mock.Mock() pl.speed = 1 S.pl_anim = { 'pre_jump_range': (32, 40), 'pre_jump_speed': 4, 'post_jump_range': (12, 30), 'post_jump_speed': 2, 'body_moving_range': (1329, 2373) } S.player = defaultdict(int) S.player['body_moving_speed'] = .2 S.ch_anim = { 'walk_range': (343, 400), 'pick_up_speed': 10, 'pick_up_range': (109, 201), } S.control_keys = { 'move_right': 'arrow_right', 'move_left': 'arrow_left', 'move_forward': 'arrow_up', 'move_backward': 'arrow_down', 'jump': 'space' }