forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
36 lines (23 loc) · 953 Bytes
/
settings.py
File metadata and controls
36 lines (23 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# encoding: utf-8
"""
Step implementations for document settings-related features
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from behave import given, then
from docx import Document
from docx.settings import Settings
from helpers import test_docx
# given ====================================================
@given('a document having a settings part')
def given_a_document_having_a_settings_part(context):
context.document = Document(test_docx('doc-word-default-blank'))
@given('a document having no settings part')
def given_a_document_having_no_settings_part(context):
context.document = Document(test_docx('set-no-settings-part'))
# then =====================================================
@then('document.settings is a Settings object')
def then_document_settings_is_a_Settings_object(context):
document = context.document
assert type(document.settings) is Settings