Skip to content

Commit d24fdad

Browse files
committed
Testing po2rst function.
1 parent 06b9e7c commit d24fdad

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/test_po2rst.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from sphinxlint import po2rst
2+
3+
4+
def test_po2rst():
5+
po = """msgid "foo"
6+
msgstr "bar"
7+
8+
msgid "test1"
9+
msgstr "test2"
10+
"""
11+
rst = """bar
12+
13+
14+
test2
15+
"""
16+
assert po2rst(po) == rst
17+
18+
19+
def test_po2rst_more():
20+
po = """msgid "foo"
21+
msgstr "bar"
22+
23+
msgid "test1"
24+
msgstr ""
25+
"test2"
26+
27+
msgid "test3"
28+
msgstr "test4"
29+
"""
30+
rst = """bar
31+
32+
33+
test2
34+
35+
36+
37+
test4
38+
"""
39+
assert po2rst(po) == rst

0 commit comments

Comments
 (0)