FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-docx/features/steps/settings.py at master · python-openxml/python-docx · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-openxml
/
python-docx
Public
Notifications
You must be signed in to change notification settings
Fork
1.3k
Star
5.7k
Code
Issues
373
Pull requests
140
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-docx
/
features
/
steps
/
settings.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (35 loc) · 1.88 KB
Breadcrumbs
python-docx
/
features
/
steps
/
settings.py
Copy path
File metadata and controls
55 lines (35 loc) · 1.88 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""Step implementations for document settings-related features."""
from
behave
import
given
,
then
,
when
from
behave
.
runner
import
Context
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
):
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
):
context
.
document
=
Document
(
test_docx
(
"set-no-settings-part"
))
@
given
(
"a Settings object {with_or_without} odd and even page headers as settings"
)
def
given_a_Settings_object_with_or_without_odd_and_even_hdrs
(
context
:
Context
,
with_or_without
:
str
):
testfile_name
=
{
"with"
:
"doc-odd-even-hdrs"
,
"without"
:
"sct-section-props"
}[
with_or_without
]
context
.
settings
=
Document
(
test_docx
(
testfile_name
)).
settings
# when =====================================================
@
when
(
"I assign {bool_val} to settings.odd_and_even_pages_header_footer"
)
def
when_I_assign_value_to_settings_odd_and_even_pages_header_footer
(
context
:
Context
,
bool_val
:
str
):
context
.
settings
.
odd_and_even_pages_header_footer
=
eval
(
bool_val
)
# then =====================================================
@
then
(
"document.settings is a Settings object"
)
def
then_document_settings_is_a_Settings_object
(
context
:
Context
):
document
=
context
.
document
assert
type
(
document
.
settings
)
is
Settings
@
then
(
"settings.odd_and_even_pages_header_footer is {bool_val}"
)
def
then_settings_odd_and_even_pages_header_footer_is
(
context
:
Context
,
bool_val
:
str
):
actual
=
context
.
settings
.
odd_and_even_pages_header_footer
expected
=
eval
(
bool_val
)
assert
actual
==
expected
,
"settings.odd_and_even_pages_header_footer is %s"
%
actual
Back
|
FazBrowse Home
|
New Git URL