aboutsummaryrefslogtreecommitdiff
path: root/tests/html_generation_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/html_generation_tests.py')
-rw-r--r--tests/html_generation_tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/html_generation_tests.py b/tests/html_generation_tests.py
index c39f886..25b4803 100644
--- a/tests/html_generation_tests.py
+++ b/tests/html_generation_tests.py
@@ -147,3 +147,25 @@ class SatisfyPathTests(object):
satisfy_html_path(generator, path)
generator.text("Hello")
assert_equal('<p class="tip">Hello', generator.html_string())
+
+
+ @istest
+ def elements_do_not_match_if_class_names_do_not_match(self):
+ generator = HtmlGenerator()
+ generator.start("p", {"class": "help"})
+ generator.text("Help")
+ path = html_paths.path([html_paths.element(["p"], class_names=["tip"])])
+ satisfy_html_path(generator, path)
+ generator.text("Tip")
+ assert_equal('<p class="help">Help</p><p class="tip">Tip', generator.html_string())
+
+
+ @istest
+ def class_names_match_if_they_are_the_same(self):
+ generator = HtmlGenerator()
+ generator.start("p", {"class": "tip"})
+ generator.text("Help")
+ path = html_paths.path([html_paths.element(["p"], class_names=["tip"])])
+ satisfy_html_path(generator, path)
+ generator.text("Tip")
+ assert_equal('<p class="tip">HelpTip', generator.html_string())