-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_builder.py
43 lines (35 loc) · 1.47 KB
/
test_builder.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
40
41
42
43
import re
from builder import FIND_FATE_FONT, REPLACE_FATE_FONT
from builder import FIND_FATE_FONT_BIG
def test_find_fate_font():
result = re.sub(
FIND_FATE_FONT,
REPLACE_FATE_FONT,
'hello <span class="fate_font">world</span>')
assert result == 'hello [span:fate_font]world[/span]'
result = re.sub(
FIND_FATE_FONT,
REPLACE_FATE_FONT,
'hello <span class="fate_font">world</span> toto')
assert result == 'hello [span:fate_font]world[/span] toto'
result = re.sub(
FIND_FATE_FONT,
REPLACE_FATE_FONT,
'hello <span class="fate_font">world</span> toto <span class="fate_font">meuh</span>') # noqa
assert result == 'hello [span:fate_font]world[/span] toto [span:fate_font]meuh[/span]' # noqa
def test_find_fate_font_big():
result = re.sub(
FIND_FATE_FONT_BIG,
REPLACE_FATE_FONT,
'hello <span class="fate_font big">world</span>')
assert result == 'hello [span:fate_font]world[/span]'
result = re.sub(
FIND_FATE_FONT_BIG,
REPLACE_FATE_FONT,
'hello <span class="fate_font big">world</span> toto')
assert result == 'hello [span:fate_font]world[/span] toto'
result = re.sub(
FIND_FATE_FONT_BIG,
REPLACE_FATE_FONT,
'hello <span class="fate_font big">world</span> toto <span class="fate_font big">meuh</span>') # noqa
assert result == 'hello [span:fate_font]world[/span] toto [span:fate_font]meuh[/span]' # noqa