def test_demo2_consistent(self):
        """
            check that 

                src/testmazes/demo2.consistent.maze

            can be parsed and that it walls are consistent
        """
        try:
            maze = MazeFileBuilder(open('testmazes/demo2.consistent.maze','r'))
        except SpecificationViolationError:
            self.fail('Valid mazefile, yet a SpecificationViolationError is still raised')
        else:
            self.assertTrue(are_walls_consistent(maze))
    def test_demo2_fixed(self):
        """
        Check that the fixed version of the original maze file for demo 2 is
        indeed fixed. I.e. the MazeFileBuilder should *not* raise an error when
        trying to parse it.

        The file can be found at

            src/testmazes/demo2.fixed.maze
        """
        try:
            maze = MazeFileBuilder(open('testmazes/demo2.fixed.maze','r'))
        except SpecificationViolationError:
            self.fail('Valid mazefile, yet a SpecificationViolationError is still raised')
        else:
            self.assertFalse(are_walls_consistent(maze))
Beispiel #3
0
    def test_demo2_consistent(self):
        """
            check that 

                src/testmazes/demo2.consistent.maze

            can be parsed and that it walls are consistent
        """
        try:
            maze = MazeFileBuilder(open('testmazes/demo2.consistent.maze',
                                        'r'))
        except SpecificationViolationError:
            self.fail(
                'Valid mazefile, yet a SpecificationViolationError is still raised'
            )
        else:
            self.assertTrue(are_walls_consistent(maze))
Beispiel #4
0
    def test_demo2_fixed(self):
        """
        Check that the fixed version of the original maze file for demo 2 is
        indeed fixed. I.e. the MazeFileBuilder should *not* raise an error when
        trying to parse it.

        The file can be found at

            src/testmazes/demo2.fixed.maze
        """
        try:
            maze = MazeFileBuilder(open('testmazes/demo2.fixed.maze', 'r'))
        except SpecificationViolationError:
            self.fail(
                'Valid mazefile, yet a SpecificationViolationError is still raised'
            )
        else:
            self.assertFalse(are_walls_consistent(maze))