@@ -90,11 +90,6 @@ def it_can_add_a_table(self, add_table_fixture):
9090 assert table == table_
9191 assert table .style == style
9292
93- def it_can_save_the_document_to_a_file (self , save_fixture ):
94- document , file_ = save_fixture
95- document .save (file_ )
96- document ._part .save .assert_called_once_with (file_ )
97-
9893 def it_provides_access_to_its_bookmarks (self , document_part_ , bookmarks_ ):
9994 document_part_ .bookmarks = bookmarks_
10095 document = Document (None , document_part_ )
@@ -108,6 +103,16 @@ def it_provides_access_to_its_core_properties(self, core_props_fixture):
108103 core_properties = document .core_properties
109104 assert core_properties is core_properties_
110105
106+ def it_can_end_a_bookmark (self , _body_prop_ , body_ , bookmark_ ):
107+ _body_prop_ .return_value = body_
108+ body_ .end_bookmark .return_value = bookmark_
109+ document = Document (None , None )
110+
111+ bookmark = document .end_bookmark (bookmark_ )
112+
113+ body_ .end_bookmark .assert_called_once_with (bookmark_ )
114+ assert bookmark is bookmark_
115+
111116 def it_provides_access_to_its_inline_shapes (self , inline_shapes_fixture ):
112117 document , inline_shapes_ = inline_shapes_fixture
113118 assert document .inline_shapes is inline_shapes_
@@ -117,6 +122,11 @@ def it_provides_access_to_its_paragraphs(self, paragraphs_fixture):
117122 paragraphs = document .paragraphs
118123 assert paragraphs is paragraphs_
119124
125+ def it_can_save_the_document_to_a_file (self , save_fixture ):
126+ document , file_ = save_fixture
127+ document .save (file_ )
128+ document ._part .save .assert_called_once_with (file_ )
129+
120130 def it_provides_access_to_its_sections (self , document_part_ , Sections_ , sections_ ):
121131 document_elm = element ("w:document" )
122132 Sections_ .return_value = sections_
0 commit comments