Ejemplo n.º 1
0
    def test_is_active_fails(self):
        """
        This method tests the functionality of the over-arching is_active method. The expected result of this test
        is for the display mode to be inactive.
        """
        dm = DisplayMode("---\n---\n---")

        # Assert that the display mode is inactive.
        assert dm.is_active() == False
Ejemplo n.º 2
0
    def test_get_display_pattern(self):
        """
        This method tests the ability of the display mode to communicate with the game engine. The expected result of
        this test is for the get_display_pattern method to first of all return its given pattern, and then the correctly
        calculated next generation of the Game of life.
        """
        dm = DisplayMode("-*-\n-*-\n-*-")

        # Assert the display mode can return its given pattern.
        assert dm.get_display_pattern() == "-*-\n-*-\n-*-"
        # Assert the display mode can use the game engine to return the next calculated pattern.
        assert dm.get_display_pattern() == "***\n***\n***"