diff options
-rw-r--r-- | rtemsspec/content.py | 6 | ||||
-rw-r--r-- | rtemsspec/tests/test_content.py | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/rtemsspec/content.py b/rtemsspec/content.py index 7e596a2e..cd122f0b 100644 --- a/rtemsspec/content.py +++ b/rtemsspec/content.py @@ -467,7 +467,9 @@ class Content: items: GenericContentIterable, prologue: Optional[GenericContent] = None, epilogue: Optional[GenericContent] = None, - add_blank_line: bool = False) -> None: + add_blank_line: bool = False, + empty: Optional[GenericContent] = None) -> None: + # pylint: disable=too-many-arguments """ Adds a list with introduction. """ if items: self.wrap(prologue) @@ -476,6 +478,8 @@ class Content: if add_blank_line: self.add_blank_line() self.wrap(epilogue) + else: + self.wrap(empty) def open_list_item(self, content: GenericContent) -> None: """ Opens a list item. """ diff --git a/rtemsspec/tests/test_content.py b/rtemsspec/tests/test_content.py index ad26972e..dbbd1564 100644 --- a/rtemsspec/tests/test_content.py +++ b/rtemsspec/tests/test_content.py @@ -218,6 +218,13 @@ def test_add_blank_line(): """ +def test_add_list_empty(): + content = Content("BSD-2-Clause", True) + content.add_list([], empty="empty") + assert str(content) == """empty +""" + + def test_ensure_blank_line(): content = Content("BSD-2-Clause", True) content.ensure_blank_line() |