mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
22 lines
562 B
Python
22 lines
562 B
Python
"""The banner prints once above top-level help and once above a subcommand's help."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import io
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
from unshackle.core.__main__ import print_banner
|
|
from unshackle.core.console import force_utf8_streams
|
|
|
|
|
|
def test_banner_prints_to_a_legacy_code_page_stream(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
buffer = io.BytesIO()
|
|
monkeypatch.setattr(sys, "stdout", io.TextIOWrapper(buffer, encoding="cp1252"))
|
|
|
|
force_utf8_streams()
|
|
print_banner()
|
|
|
|
assert "▄".encode() in buffer.getvalue()
|