def testUnsuccesfullMove(self): """Test moving to a blocked direction""" charactor = Charactor(self.event_manager) sector = Sector() charactor.place(sector) event = self.event_tester.last_event() charactor.move(shallowspace.constants.DIRECTION_UP) self.assertEqual(self.event_tester.last_event(), event) self.assertEqual(charactor.sector, sector)
def testSuccesfullMove(self): """Test moving to a non-blocked direction""" charactor = Charactor(self.event_manager) sector = Sector() charactor.place(sector) neighboring_sector = Sector() sector.neighbors[shallowspace.constants.DIRECTION_UP] = neighboring_sector charactor.move(shallowspace.constants.DIRECTION_UP) self.assertTrue(isinstance(self.event_tester.last_event(), CharactorMoveEvent)) self.assertEqual(charactor.sector, neighboring_sector)