@@ -214,6 +214,14 @@ def it_knows_its_id(self):
214214
215215 assert bookmark .id == 42
216216
217+ def it_knows_whether_it_is_closed (self , is_closed_fixture ):
218+ bookmarkStart , bookmarkEnd , expected_value = is_closed_fixture
219+ bookmark = _Bookmark ((bookmarkStart , bookmarkEnd ))
220+
221+ is_closed = bookmark .is_closed
222+
223+ assert is_closed == expected_value
224+
217225 def it_knows_its_name (self ):
218226 bookmarkStart = element ("w:bookmarkStart{w:name=bmk-0}" )
219227 bookmarkEnd = element ("w:bookmarkEnd" )
@@ -222,6 +230,21 @@ def it_knows_its_name(self):
222230
223231 assert bookmark .name == "bmk-0"
224232
233+ # fixtures -------------------------------------------------------
234+
235+ @pytest .fixture (
236+ params = [
237+ (None , None , False ), # ---not expected---
238+ ("w:bookmarkStart" , None , False ),
239+ ("w:bookmarkStart" , "w:bookmarkEnd" , True ),
240+ ]
241+ )
242+ def is_closed_fixture (self , request ):
243+ bookmarkStart_cxml , bookmarkEnd_cxml , expected_value = request .param
244+ bookmarkStart = element (bookmarkStart_cxml ) if bookmarkStart_cxml else None
245+ bookmarkEnd = element (bookmarkEnd_cxml ) if bookmarkEnd_cxml else None
246+ return bookmarkStart , bookmarkEnd , expected_value
247+
225248
226249class Describe_DocumentBookmarkFinder (object ):
227250 def it_finds_all_the_bookmark_pairs_in_the_document (
0 commit comments