File: test_raw_display.py

package info (click to toggle)
urwid 3.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,232 kB
  • sloc: python: 29,010; javascript: 382; sh: 34; makefile: 22
file content (14 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from __future__ import annotations

import unittest

import urwid


class TestRawDisplay(unittest.TestCase):
    def test_attrspec_to_escape(self):
        s = urwid.display.raw.Screen()
        s.set_terminal_properties(colors=256)
        a2e = s._attrspec_to_escape
        self.assertEqual("\x1b[0;33;42m", a2e(s.AttrSpec("brown", "dark green")))
        self.assertEqual("\x1b[0;38;5;229;4;48;5;164m", a2e(s.AttrSpec("#fea,underline", "#d0d")))