Ignore:
Timestamp:
09/03/13 18:06:12 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Some refactoring and fixing, start of better collision handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/tests/test_game_object.py

    r145 r186  
    4444        return puzzler
    4545
    46     def assert_floor_switch(self, expected, shapes):
     46    def assert_collide_state(self, expected, shapes, collision_types):
    4747        gobj = FakeGameObject(None, FakeSpace(*shapes))
    48         puzzler = self.mkpuzzler(gobj, game_object.FloorSwitchPuzzler)
     48        puzzler = self.mkpuzzler(
     49            gobj, game_object.CollidePuzzler, *collision_types)
    4950        self.assertEqual(expected, puzzler.get_state())
    5051
    51     def test_floor_switch_puzzler(self):
    52         self.assert_floor_switch(False, [])
    53         self.assert_floor_switch(False, [FakeShape()])
     52    def test_collide_puzzler(self):
     53        self.assert_collide_state(False, [], [])
     54        self.assert_collide_state(False, [FakeShape()], SWITCH_PUSHERS)
    5455
    5556        for collision_type in SWITCH_PUSHERS:
    56             self.assert_floor_switch(True, [FakeShape(collision_type)])
    57             self.assert_floor_switch(
    58                 True, [FakeShape(), FakeShape(collision_type)])
     57            self.assert_collide_state(
     58                True, [FakeShape(collision_type)], SWITCH_PUSHERS)
     59            self.assert_collide_state(
     60                True, [FakeShape(), FakeShape(collision_type)], SWITCH_PUSHERS)
    5961
    6062    def test_state_proxy_puzzler(self):
Note: See TracChangeset for help on using the changeset viewer.