def test_obst(self): """Diagonally move""" matr1 = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] self.assertFalse(a.find_way((1, 1), (4, 4), a.make_border(matr1)))
def test_lazytest(self): """No moving""" matr1 = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] self.assertFalse(a.find_way((0, 0), (0, 0), a.make_border(matr1)))
def test_hard_labirinth(self): """Hard way""" matr2 = [[0, 0, 1, 0, 0], [1, 0, 1, 0, 0], [0, 0, 1, 0, 0], [0, 1, 1, 0, 0], [0, 0, 0, 0, 0]] self.assertTrue(a.find_way((1, 1), (1, 4), a.make_border(matr2)))
def test_obstacles(self): """No way""" matr3 = [[0, 0, 1, 0], [0, 0, 1, 0], [1, 1, 1, 0], [0, 0, 0, 0]] self.assertFalse(a.find_way((0, 0), (3, 3), a.make_border(matr3)))
def test_no_obst(self): """Easy way""" matr1 = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] self.assertTrue(a.find_way((1, 1), (4, 4), a.make_border(matr1)))