Code Duplication    Length = 17-21 lines in 2 locations

intelligine/tests/simulation/molecule/TestDirection.py 2 locations

@@ 131-151 (lines=21) @@
128
        for direction_wanted in test_data:
129
            self._test_direction_for_point(test_data[direction_wanted], direction_wanted)
130
131
    def test_route_with_multiple_different_intensity(self):
132
        """
133
        Test find route in middle of multiple molecules
134
        :return:
135
        """
136
        test_data = {
137
            NORTH_WEST: {
138
                _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 2, 0)}},
139
                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2, 0)}},
140
                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (8, 1, 0)}}
141
            },
142
            NORTH_WEST: {
143
                _p(CENTER): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (10, 2, 0)}},
144
                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 2, 0)}},
145
                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (8, 1, 0)}},
146
                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (5, 10, 0)}}  # an other molecule type
147
            }
148
        }
149
150
        for direction_wanted in test_data:
151
            self._test_direction_for_point(test_data[direction_wanted], direction_wanted)
152
153
    def test_direction_direct(self):
154
        test_data = {
@@ 167-183 (lines=17) @@
164
        for direction in test_data:
165
            self._test_direction_for_points(test_data[direction], direction)
166
167
    def test_direction_with_multiple_intensity(self):
168
        test_data = {
169
            NORTH: {
170
                _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 5, 0)}},
171
                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4, 0)}},
172
                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4, 0)}}
173
            },
174
            NORTH: {
175
                _p(NORTH): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 5, 0)}},
176
                _p(WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_NONE: (9, 500, 0)}},  # An other molecule_type
177
                _p(SOUTH_EST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4, 0)}},
178
                _p(NORTH_WEST): {MOLECULES_DIRECTION: {PHEROMON_DIR_EXPLO: (9, 4, 0)}}
179
            }
180
        }
181
182
        for direction in test_data:
183
            self._test_direction_for_points(test_data[direction], direction)
184
185
    def test_no_molecules_around(self):
186
        # No molecule