-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_print.py
39 lines (35 loc) · 1.17 KB
/
test_print.py
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
36
37
38
39
# -*- coding: utf-8 -*-
# Copyright © 2022-present Worldr Technologies Limited. All Rights Reserved.
# type: ignore
import pytest
from setupr.print import wprint
TXT = "I Am Malenia, Blade Of Miquella, And I Have Never Known Defeat."
TXT_FMT = (
"[i]I Am Malenia[/i], "
"[b][red]Blade Of Miquella[/red][/b], And "
"[i][b]I Have [blue]Never[/blue] Known Defeat.[/i][/b]"
":skull:"
)
@pytest.mark.parametrize(
("level", "extra", "text"),
[
(None, None, TXT),
("note", None, TXT),
("info", ":thumbs_up:", TXT),
("warning", ":warning-emoji:", TXT),
("success", ":heavy_check_mark:", TXT),
("failure", ":x:", TXT),
(None, None, TXT_FMT),
("note", None, TXT_FMT),
("info", ":thumbs_up:", TXT_FMT),
("warning", ":warning-emoji:", TXT_FMT),
("success", ":heavy_check_mark:", TXT_FMT),
("failure", ":x:", TXT_FMT),
],
)
def test_wprint(level, extra, text, mock_console):
wprint(text, level)
assert mock_console.print.called
assert text in mock_console.print.call_args.args[0]
if extra is not None:
assert extra in mock_console.print.call_args.args[0]