summaryrefslogtreecommitdiff
path: root/tests/html_generation_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 15:38:28 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 15:38:28 +0000
commit2920e3642ccc1afcd22cf5d4de5fd92f2cee5003 (patch)
tree4264b07ba214b98c11dfd751ab602a539507671a /tests/html_generation_tests.py
parent93c52cf6be9633f97e903233db47648844407d2e (diff)
Match class names when satisfying HTML paths
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())