Пример #1
0
 def testMoveNotPossible(self):
     """Test illegal moves"""
     sector = Sector()
     self.assertFalse(sector.move_possible(DIRECTION_UP))
     self.assertFalse(sector.move_possible(DIRECTION_RIGHT))
     self.assertFalse(sector.move_possible(DIRECTION_DOWN))
     self.assertFalse(sector.move_possible(DIRECTION_LEFT))
Пример #2
0
 def testMovePossible(self):
     """Test legal moves"""
     sector = Sector()
     sector.neighbors = [Sector() for x in xrange(4)]
     self.assertTrue(sector.move_possible(DIRECTION_UP))
     self.assertTrue(sector.move_possible(DIRECTION_RIGHT))
     self.assertTrue(sector.move_possible(DIRECTION_DOWN))
     self.assertTrue(sector.move_possible(DIRECTION_LEFT))