aboutsummaryrefslogtreecommitdiffstats
path: root/test_generate_html.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-10-17 11:52:46 +0200
committerMatěj Cepl <mcepl@redhat.com>2012-10-17 11:55:12 +0200
commit45fc7f9dad3096ea07eba0cce8b791c915f3ceda (patch)
tree2b7abaf5200122d65b18d5b6b3fa52a98ff4d8c8 /test_generate_html.py
parent5a11116ed8408df10d6897edd66dac575e13636c (diff)
downloadhesla-45fc7f9dad3096ea07eba0cce8b791c915f3ceda.tar.gz
Use templates (jinja2) for generating HTML.
Also add HTML links were practicable.
Diffstat (limited to 'test_generate_html.py')
-rwxr-xr-xtest_generate_html.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test_generate_html.py b/test_generate_html.py
index 502470f..405ecf0 100755
--- a/test_generate_html.py
+++ b/test_generate_html.py
@@ -3,6 +3,7 @@ import unittest
import generate_html
import subprocess
import lxml.etree as et
+import lxml.html
TEST_FILE = "hes12kni.tab"
test_dict = {'no': '1', 'de_name': '1.Mose',
@@ -30,13 +31,13 @@ class TestProcessLosungen(unittest.TestCase):
def test_attributes_on_articles(self):
# Every article has to have id attribute
- root = et.fromstring(self.los_elements)
+ root = lxml.html.fromstring(self.los_elements)
empty_articles = root.xpath("//article[not(@id)]")
self.assertEqual(len(empty_articles), 0)
def test_appropriate_elements(self):
# We need one <script> and one <style> elements in <head>
- root = et.fromstring(self.los_elements)
+ root = lxml.html.fromstring(self.los_elements)
script_element = root.xpath("//head/script")
self.assertEqual(len(script_element), 1)
self.assertEqual(script_element[0].attrib["src"], "hesla.js")