diff --git a/tests/test_fotogrid.py b/tests/test_fotogrid.py index 5a34103..6facae8 100644 --- a/tests/test_fotogrid.py +++ b/tests/test_fotogrid.py @@ -6,14 +6,22 @@ from lxml import etree from io import StringIO def check_if_valid_html(html): + """ + GIVEN an html string + WHEN parsing the html string results in an error + THEN assert + """ parser = etree.HTMLParser(recover=False) etree.parse(StringIO(html), parser) assert len(parser.error_log) == 0 def test_fotogrid_empty_list(): - urls = [] - html = fotogrid(urls) + """ + WHEN creating a fotogrid without any image url + THEN expecting an empty result (no html code at all) + """ + html = fotogrid([]) assert len(html) == 0 @@ -26,7 +34,11 @@ def check_if_images_result_in(nbr_of_images, rows_expected, cols_expected): assert html.count("