summaryrefslogtreecommitdiff
path: root/tests/execute/test_stream.py
blob: fe9dd5637f8ef6df46c2dd81a86b41e07a3971b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from __future__ import annotations

from colorama import Fore

from tox.execute.stream import SyncWrite


def test_sync_write_repr() -> None:
    sync_write = SyncWrite(name="a", target=None, color=Fore.RED)
    assert repr(sync_write) == f"SyncWrite(name='a', target=None, color={Fore.RED!r})"


def test_sync_write_decode_surrogate() -> None:
    sync_write = SyncWrite(name="a", target=None)
    sync_write.handler(b"\xed\n")
    assert sync_write.text == "\udced\n"