浏览代码

fix tests

Bastien Sevajol 6 年前
父节点
当前提交
61ad28d487
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      tests/test_move.py

+ 8 - 1
tests/test_move.py 查看文件

4
 from freezegun import freeze_time
4
 from freezegun import freeze_time
5
 
5
 
6
 from synergine2.config import Config
6
 from synergine2.config import Config
7
+from synergine2_cocos2d.user_action import UserAction
7
 from synergine2_xyz.move import MoveToBehaviour, MoveToMechanism, MoveToIntention, StartMoveEvent, FinishMoveEvent
8
 from synergine2_xyz.move import MoveToBehaviour, MoveToMechanism, MoveToIntention, StartMoveEvent, FinishMoveEvent
8
 from synergine2_xyz.simulation import XYZSimulation
9
 from synergine2_xyz.simulation import XYZSimulation
9
 from synergine2_xyz.subjects import XYZSubject
10
 from synergine2_xyz.subjects import XYZSubject
24
             'game': {
25
             'game': {
25
                 'move': {
26
                 'move': {
26
                     'walk_ref_time': 2,
27
                     'walk_ref_time': 2,
28
+                    'run_ref_time': 2,
29
+                    'crawl_ref_time': 2,
27
                 }
30
                 }
28
             }
31
             }
29
         })
32
         })
32
         behaviour = MoveToBehaviour(config, simulation, subject)
35
         behaviour = MoveToBehaviour(config, simulation, subject)
33
 
36
 
34
         with freeze_time("2000-01-01 00:00:00"):
37
         with freeze_time("2000-01-01 00:00:00"):
35
-            move_intention = MoveToIntention((0, 3), time.time())
38
+            move_intention = MoveToIntention((0, 3), time.time(), gui_action=UserAction.ORDER_MOVE)
36
 
39
 
37
             assert move_intention.path_progression == -1
40
             assert move_intention.path_progression == -1
38
             assert move_intention.just_reach is False
41
             assert move_intention.just_reach is False
44
                 'last_intention_time': time.time(),
47
                 'last_intention_time': time.time(),
45
                 'just_reach': False,
48
                 'just_reach': False,
46
                 'initial': True,
49
                 'initial': True,
50
+                'gui_action': UserAction.ORDER_MOVE,
47
             }
51
             }
48
             data = {
52
             data = {
49
                 MoveToMechanism: move_data,
53
                 MoveToMechanism: move_data,
82
                        'just_reach': False,
86
                        'just_reach': False,
83
                        'last_intention_time': 946684800.0,
87
                        'last_intention_time': 946684800.0,
84
                        'reach_next': True,
88
                        'reach_next': True,
89
+                       'gui_action': UserAction.ORDER_MOVE,
85
                    } == run_data
90
                    } == run_data
86
 
91
 
87
             events = behaviour.action(run_data)
92
             events = behaviour.action(run_data)
105
                        'just_reach': True,
110
                        'just_reach': True,
106
                        'last_intention_time': 946684802.0,
111
                        'last_intention_time': 946684802.0,
107
                        'reach_next': False,
112
                        'reach_next': False,
113
+                       'gui_action': UserAction.ORDER_MOVE,
108
                    } == run_data
114
                    } == run_data
109
 
115
 
110
             events = behaviour.action(run_data)
116
             events = behaviour.action(run_data)
128
                        'just_reach': False,
134
                        'just_reach': False,
129
                        'last_intention_time': 946684802.0,
135
                        'last_intention_time': 946684802.0,
130
                        'reach_next': True,
136
                        'reach_next': True,
137
+                       'gui_action': UserAction.ORDER_MOVE,
131
                    } == run_data
138
                    } == run_data
132
 
139
 
133
             events = behaviour.action(run_data)
140
             events = behaviour.action(run_data)