diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-12-23 00:56:59 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-12-23 00:56:59 +0100 |
commit | c3160c44d022d3c7bd245cb150f99be69f0d115e (patch) | |
tree | 7333c8f2159ba7262e92bc768266a0b02ea29887 /test_generate_html.py | |
parent | 08893d5fb0dbbdce85aaa25d771cf239d9e45b16 (diff) | |
download | hesla-c3160c44d022d3c7bd245cb150f99be69f0d115e.tar.gz |
Add an unit test for bug# 78.
Diffstat (limited to 'test_generate_html.py')
-rwxr-xr-x | test_generate_html.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test_generate_html.py b/test_generate_html.py index cc7e041..b077b2c 100755 --- a/test_generate_html.py +++ b/test_generate_html.py @@ -18,6 +18,36 @@ class TestProcessCSV(unittest.TestCase): self.assertEqual(len(los_dict), 78) self.assertEqual(los_dict['Gn'], test_dict) +class TestMethods(unittest.TestCase): + def test_translate_book_abbrs(self): + """ + Example XML piece: + Description of bug #78: + Czech biblical references are not understood by crosswire + website. So, when I ask for J 6:39, I get a book of Joshua, + not the gospel of John. + """ + test_element_str = ''' + <LOSUNG d="24" m="10"> + <TL>Středa 24. října 2012</TL> + <OT> + <S b="Ez" ch="34" v="16"/> + <L>Ztracenou vypátrám, zaběhlou přivedu zpět.</L> + <SL>Ezechiel 34,16</SL> + </OT> + <NT> + <S b="J" ch="6" v="39"/> + <L>Jeho vůle jest, abych neztratil nikoho z těch, které mi dal,</L> + <L>ale vzkřísil je v poslední den.</L> + <SL>Jan 6,39</SL> + </NT> + <SR><SL>1.Mojžíšova 24,54b-67</SL></SR> + <CR><SL>2.Korintským 4,1-6</SL></CR> + </LOSUNG> + ''' + test_element = et.fromstring(test_element_str) + wword = generate_html.parse_one(test_element) + self.assertEqual(wword['watchwords'][1]['int_ref_id']['book'],'John') class TestProcessLosungen(unittest.TestCase): def setUp(self): |