File: test_log_symbols.py

package info (click to toggle)
python-log-symbols 0.0.14-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: python: 91; makefile: 3
file content (35 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
# -*- coding: utf-8 -*-
"""This module tests LogSymbol enum."""
import re
import unittest

from log_symbols import LogSymbols

from tests._utils import strip_ansi


class TestLogSymbols(unittest.TestCase):
    """Test LogSymbols enum for attribute values."""

    def test_symbols(self):
        """Test the symbols in LogSymbol enum."""
        self.assertTrue(
            strip_ansi(LogSymbols.SUCCESS.value) in ('✔', 'v')
        )

        self.assertTrue(
            strip_ansi(LogSymbols.INFO.value) in ('ℹ', '¡')
        )

        self.assertTrue(
            strip_ansi(LogSymbols.WARNING.value) in ('⚠', '!!')
        )

        self.assertTrue(
            strip_ansi(LogSymbols.ERROR.value) in ('✖', '×')
        )


if __name__ == '__main__':
    SUITE = unittest.TestLoader().loadTestsFromTestCase(TestLogSymbols)
    unittest.TextTestRunner(verbosity=2).run(SUITE)