forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.py
More file actions
33 lines (22 loc) · 722 Bytes
/
helpers.py
File metadata and controls
33 lines (22 loc) · 722 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
# encoding: utf-8
"""
Helper methods and variables for acceptance tests.
"""
import os
def absjoin(*paths):
return os.path.abspath(os.path.join(*paths))
thisdir = os.path.split(__file__)[0]
scratch_dir = absjoin(thisdir, '../_scratch')
# scratch output docx file -------------
saved_docx_path = absjoin(scratch_dir, 'test_out.docx')
test_text = 'python-docx was here!'
def test_docx(name):
"""
Return the absolute path to test .docx file with root name *name*.
"""
return absjoin(thisdir, 'test_files', '%s.docx' % name)
def test_file_path(name):
"""
Return the absolute path to file with *name* in test_files directory
"""
return absjoin(thisdir, 'test_files', '%s' % name)