Bastien Sevajol 6 anni fa
parent
commit
61ad28d487
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      tests/test_move.py

+ 8 - 1
tests/test_move.py Vedi File

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