Ver código fonte

adapt tests to updates

Bastien Sevajol 9 anos atrás
pai
commit
12c2bf121d

+ 3 - 4
intelligine/tests/simulation/mode/TestChangeMode.py Ver arquivo

@@ -126,7 +126,6 @@ class TestChangeMode(Base):
126 126
 
127 127
         self._run_and_get_core(4)
128 128
         self.assertEquals((0, 0, 0), self.ant.get_position())
129
-        # Ant has put his food piece
130
-        self.assertFalse(self.ant.is_carrying())
131
-        self.assertEquals(MOVE_MODE_EXPLO, self.ant.get_brain().get_movement_mode())
132
-        self.assertEquals(PHEROMON_DIR_NONE, self.ant.get_movement_molecule_gland().get_molecule_type())
129
+        # Ant has NOT put his food piece
130
+        self.assertTrue(self.ant.is_carrying())
131
+        # TODO: Le "poser" depend maintenant de matiere où poser. Tests à ecrires.

+ 6 - 6
intelligine/tests/simulation/molecule/TestDirection.py Ver arquivo

@@ -9,7 +9,7 @@ ppath.insert(1,getcwd()+'/modules')
9 9
 from intelligine.tests.simulation.molecule.Base import Base
10 10
 from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
11 11
 from intelligine.core.Context import Context
12
-from intelligine.cst import MOLECULES_DIRECTION, PHEROMON_DIR_EXPLO
12
+from intelligine.cst import MOLECULES_DIRECTION, PHEROMON_DIR_EXPLO, PHEROMON_DIR_NONE
13 13
 from intelligine.synergy.event.move.direction import NORTH, NORTH_EST, EST, SOUTH_EST, SOUTH, SOUTH_WEST, WEST, \
14 14
     NORTH_WEST, CENTER
15 15
 from intelligine.synergy.event.move.direction import get_position_with_direction_decal as _p
@@ -126,7 +126,7 @@ class TestDirection(Base):
126 126
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 1)}},
127 127
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 1)}},
128 128
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (12, 1)}},
129
-                _p(SOUTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_HOME: (8, 1)}}
129
+                _p(SOUTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (8, 1)}}
130 130
             },
131 131
         }
132 132
 
@@ -148,7 +148,7 @@ class TestDirection(Base):
148 148
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 2)}},
149 149
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2)}},
150 150
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (8, 1)}},
151
-                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_HOME: (5, 10)}}  # an other molecule type
151
+                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (5, 10)}}  # an other molecule type
152 152
             }
153 153
         }
154 154
 
@@ -162,7 +162,7 @@ class TestDirection(Base):
162 162
             },
163 163
             NORTH: {
164 164
                 _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2)}},
165
-                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_HOME: (9, 500)}}  # An other molecule type
165
+                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (9, 500)}}  # An other molecule type
166 166
             }
167 167
         }
168 168
 
@@ -178,7 +178,7 @@ class TestDirection(Base):
178 178
             },
179 179
             NORTH: {
180 180
                 _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 5)}},
181
-                _p(WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_HOME: (9, 500)}},  # An other molecule_type
181
+                _p(WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (9, 500)}},  # An other molecule_type
182 182
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}},
183 183
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}}
184 184
             }
@@ -197,7 +197,7 @@ class TestDirection(Base):
197 197
         # Wrong molecule type
198 198
         try:  # WTF ?
199 199
             self.assertRaises(NoMolecule, self._test_direction_for_points({
200
-                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_HOME: (9, 5)}}
200
+                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (9, 5)}}
201 201
             }, -1))
202 202
         except NoMolecule:
203 203
             self.assertTrue(True)