예제 #1
0
파일: test_card.py 프로젝트: zphj1987/rich
def test_card_render():
    card = make_test_card()
    result = render(card)
    assert result == expected
예제 #2
0
파일: test_card.py 프로젝트: zphj1987/rich
from rich.__main__ import make_test_card

from render import render

try:
    from _card_render import expected
except ImportError:
    expected = None


def test_card_render():
    card = make_test_card()
    result = render(card)
    assert result == expected


if __name__ == "__main__":
    card = make_test_card()
    with open("_card_render.py", "wt") as fh:
        card_render = render(card)
        print(card_render)
        fh.write(f"expected={card_render!r}")