|
1 | 1 | # encoding: utf-8 |
2 | 2 |
|
3 | | -""" |
4 | | -Step implementations for document-related features |
5 | | -""" |
| 3 | +"""Step implementations for document-related features""" |
6 | 4 |
|
7 | | -from __future__ import absolute_import, print_function, unicode_literals |
| 5 | +from __future__ import absolute_import, division, print_function, unicode_literals |
8 | 6 |
|
9 | 7 | from behave import given, then, when |
10 | 8 |
|
@@ -70,6 +68,11 @@ def given_a_single_section_Document_object_with_headers_and_footers(context): |
70 | 68 | context.document = Document(test_docx("doc-add-section")) |
71 | 69 |
|
72 | 70 |
|
| 71 | +@given('an open Bookmark object named "Target" as bookmark') |
| 72 | +def given_an_open_Bookmark_object_named_Target_as_bookmark(context): |
| 73 | + context.bookmark = context.document.start_bookmark("Target") |
| 74 | + |
| 75 | + |
73 | 76 | # when ==================================================== |
74 | 77 |
|
75 | 78 |
|
@@ -182,6 +185,17 @@ def when_I_execute_section_eq_document_add_section(context): |
182 | 185 | # then ==================================================== |
183 | 186 |
|
184 | 187 |
|
| 188 | +@then('bookmark == document.bookmarks.get("Target")') |
| 189 | +def then_bookmark_eq_document_bookmarks_get_Target(context): |
| 190 | + assert context.bookmark == context.document.bookmarks.get("Target") |
| 191 | + |
| 192 | + |
| 193 | +@then("bookmark == document.end_bookmark(bookmark)") |
| 194 | +def then_bookmark_eq_document_end_bookmark(context): |
| 195 | + bookmark = context.bookmark |
| 196 | + assert bookmark == context.document.end_bookmark(bookmark) |
| 197 | + |
| 198 | + |
185 | 199 | @then("document.bookmarks is a Bookmarks object") |
186 | 200 | def then_document_bookmarks_is_a_Bookmarks_object(context): |
187 | 201 | actual = context.document.bookmarks.__class__.__name__ |
|
0 commit comments