    def test_ansi_terminal_parser_palette(self):
        """
        Check AnsiTerminalParser colour palettes work as expected.
        """
        parser = AnsiTerminalParser()
        parser.reset(
            "\x1B[38;1ma\x1B[38;5;17mb\x1B[48;2;1;2;3mc\x1B[48;5;54md\x1B[999me\x1B[93m\x1B[104m", None)
        tokens = parser.parse()

        # Bad colour scheme - ignore
        self.assertEqual(next(tokens), (0, Parser.DISPLAY_TEXT, "a"))

        # Standard colour palette
        self.assertEqual(next(tokens), (8, Parser.CHANGE_COLOURS, (17, None, None)))
        self.assertEqual(next(tokens), (8, Parser.DISPLAY_TEXT, "b"))

        # RGB colour scheme - ignore
        self.assertEqual(next(tokens), (19, Parser.DISPLAY_TEXT, "c"))

        # Standard colour palette
        self.assertEqual(next(tokens), (33, Parser.CHANGE_COLOURS, (17, None, 54)))
        self.assertEqual(next(tokens), (33, Parser.DISPLAY_TEXT, "d"))

        # Unknown parameter
        self.assertEqual(next(tokens), (44, Parser.DISPLAY_TEXT, "e"))

        # Intense colour palette
        self.assertEqual(next(tokens), (51, Parser.CHANGE_COLOURS, (11, None, 54)))
        self.assertEqual(next(tokens), (51, Parser.CHANGE_COLOURS, (11, None, 12)))
Check AnsiTerminalParser colour palettes work as expected.
tests/test_parsers.py