2
0
Fork 0
textout/tests/test_htmli.py

31 lines
828 B
Python
Executable File

#!/usr/bin/env python3
#******************************************************************************
# Copyright (C) 2018 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
# This file is part of the textoutpc project, which is MIT-licensed.
#******************************************************************************
""" Unit tests for the Python version of textout. """
import pytest
from textoutpc import tohtml as _tohtml
@pytest.mark.parametrize('test_input,expected', (
# Basic text.
('', ''),
('lol', 'lol'),
# Basic text styling.
('[u][b]a[/]mdr', '<u><b>a</b>mdr</u>'),
# Links.
('[url=https://thomas.touhey.fr/]',
'<a href="https://thomas.touhey.fr/">https://thomas.touhey.fr/</a>'),
))
def test_htmli(test_input, expected):
assert _tohtml(test_input, inline = True) == expected
# End of file.