File: test_clistyle.py

package info (click to toggle)
mycli 1.42.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,036 kB
  • sloc: python: 8,587; makefile: 10
file content (29 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# type: ignore

"""Test the mycli.clistyle module."""

from pygments.style import Style
from pygments.token import Token
import pytest

from mycli.clistyle import style_factory


@pytest.mark.skip(reason="incompatible with new prompt toolkit")
def test_style_factory():
    """Test that a Pygments Style class is created."""
    header = "bold underline #ansired"
    cli_style = {"Token.Output.Header": header}
    style = style_factory("default", cli_style)

    assert isinstance(style(), Style)
    assert Token.Output.Header in style.styles
    assert header == style.styles[Token.Output.Header]


@pytest.mark.skip(reason="incompatible with new prompt toolkit")
def test_style_factory_unknown_name():
    """Test that an unrecognized name will not throw an error."""
    style = style_factory("foobar", {})

    assert isinstance(style(), Style)