Example #1
0
 def testRemoveExit(self):
     cell = Cell()
     cell.addExit(1, 0)
     
     cell.removeExit(1, 0)
     
     self.assertFalse(cell.hasExit(1, 0))
Example #2
0
 def testAddOpposite(self):
     cell = Cell()
     cell.addExit(1, 0)
     
     with self.assertRaises(InvalidExitError) as result:
         cell.addExit(-1, 0)
     
     self.assertEqual('Invalid exit (-1, 0) when (1, 0) is present.',
                      result.exception.message)
Example #3
0
 def testAddExit(self):
     cell = Cell()
     cell.addExit(1, 0)
     
     self.assertTrue(cell.hasExit(1, 0))
     self.assertFalse(cell.hasExit(-1, 0))