File: test_various.py

package info (click to toggle)
mkdocs-test 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 424 kB
  • sloc: python: 938; sh: 34; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Various tests

(C) Laurent Franceschetti 2025
"""
from mkdocs_test.common import strip_ansi_colors


def test_strip_colors():
    "Strip colored text instructions"
    FIND = "\x1b[31m"
    colored_text = "\x1b[31mThis is red\x1b[0m and this is normal"
    assert FIND in colored_text
    clean_text = strip_ansi_colors(colored_text)
    assert isinstance(clean_text, str)
    assert FIND not in clean_text
    print(clean_text)  # Output: This is red and this is normal