Browse Source

adapt tests to updates

Bastien Sevajol 9 years ago
parent
commit
12c2bf121d

+ 3 - 4
intelligine/tests/simulation/mode/TestChangeMode.py View File

126
 
126
 
127
         self._run_and_get_core(4)
127
         self._run_and_get_core(4)
128
         self.assertEquals((0, 0, 0), self.ant.get_position())
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 View File

9
 from intelligine.tests.simulation.molecule.Base import Base
9
 from intelligine.tests.simulation.molecule.Base import Base
10
 from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
10
 from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
11
 from intelligine.core.Context import Context
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
 from intelligine.synergy.event.move.direction import NORTH, NORTH_EST, EST, SOUTH_EST, SOUTH, SOUTH_WEST, WEST, \
13
 from intelligine.synergy.event.move.direction import NORTH, NORTH_EST, EST, SOUTH_EST, SOUTH, SOUTH_WEST, WEST, \
14
     NORTH_WEST, CENTER
14
     NORTH_WEST, CENTER
15
 from intelligine.synergy.event.move.direction import get_position_with_direction_decal as _p
15
 from intelligine.synergy.event.move.direction import get_position_with_direction_decal as _p
126
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 1)}},
126
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 1)}},
127
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 1)}},
127
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 1)}},
128
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (12, 1)}},
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
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 2)}},
148
                 _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 2)}},
149
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2)}},
149
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2)}},
150
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (8, 1)}},
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
             },
162
             },
163
             NORTH: {
163
             NORTH: {
164
                 _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2)}},
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
             },
178
             },
179
             NORTH: {
179
             NORTH: {
180
                 _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 5)}},
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
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}},
182
                 _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}},
183
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}}
183
                 _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4)}}
184
             }
184
             }
197
         # Wrong molecule type
197
         # Wrong molecule type
198
         try:  # WTF ?
198
         try:  # WTF ?
199
             self.assertRaises(NoMolecule, self._test_direction_for_points({
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
             }, -1))
201
             }, -1))
202
         except NoMolecule:
202
         except NoMolecule:
203
             self.assertTrue(True)
203
             self.assertTrue(True)