File: test_style.py

package info (click to toggle)
zabbix-cli 3.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,860 kB
  • sloc: python: 18,557; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from __future__ import annotations

from zabbix_cli.output.style import Color


def test_color_call() -> None:
    assert Color.INFO("test") == "[default]test[/]"
    assert Color.SUCCESS("test") == "[green]test[/]"
    assert Color.WARNING("test") == "[yellow]test[/]"
    assert Color.ERROR("test") == "[red]test[/]"

    # Ensure it doesnt break normal instantiation with a value
    assert Color("default") == Color.INFO
    assert Color("yellow") == Color.WARNING