@@ -214,6 +214,14 @@ def it_knows_its_id(self):
214
214
215
215
assert bookmark .id == 42
216
216
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
+
217
225
def it_knows_its_name (self ):
218
226
bookmarkStart = element ("w:bookmarkStart{w:name=bmk-0}" )
219
227
bookmarkEnd = element ("w:bookmarkEnd" )
@@ -222,6 +230,21 @@ def it_knows_its_name(self):
222
230
223
231
assert bookmark .name == "bmk-0"
224
232
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
+
225
248
226
249
class Describe_DocumentBookmarkFinder (object ):
227
250
def it_finds_all_the_bookmark_pairs_in_the_document (
0 commit comments