File tree Expand file tree Collapse file tree 3 files changed +60
-94
lines changed Expand file tree Collapse file tree 3 files changed +60
-94
lines changed Original file line number Diff line number Diff line change 11
11
)
12
12
from unittest import TestCase
13
13
14
+ STYLE = '<style>.insert {color:green;}.delete {color:red;text-decoration:line-through;}.center {text-align:center;}.right {text-align:right;}.left {text-align:left;}.comment {color:blue;}body {width:0px;margin:0px auto;}</style>' # noqa
15
+
16
+ BASE_HTML = '''
17
+ <html>
18
+ <head>
19
+ %s
20
+ </head>
21
+ <body>%%s</body>
22
+ </html>
23
+ ''' % STYLE
24
+
14
25
15
26
def assert_html_equal (actual_html , expected_html ):
16
27
assert collapse_html (
@@ -99,8 +110,8 @@ def _parse_styles(self):
99
110
'1' : 'decimal' ,
100
111
},
101
112
'2' : {
102
- '0' : 'none ' ,
103
- '1' : 'none ' ,
113
+ '0' : 'lowerLetter ' ,
114
+ '1' : 'lowerLetter ' ,
104
115
},
105
116
}
106
117
@@ -136,4 +147,4 @@ def test_expected_output(self):
136
147
numbering_dict = self .numbering_dict ,
137
148
).parsed
138
149
139
- assert_html_equal (html , self .expected_output )
150
+ assert_html_equal (html , BASE_HTML % self .expected_output )
Original file line number Diff line number Diff line change 6
6
from nose .plugins .skip import SkipTest
7
7
#from nose.tools import assert_raises
8
8
9
- from pydocx .tests import assert_html_equal
9
+ from pydocx .tests import assert_html_equal , BASE_HTML
10
10
from pydocx .parsers .Docx2Html import Docx2Html
11
11
12
12
13
13
def convert (path ):
14
14
return Docx2Html (path ).parsed
15
15
16
- STYLE = '<style>.insert {color:green;}.delete {color:red;text-decoration:line-through;}.center {text-align:center;}.right {text-align:right;}.left {text-align:left;}.comment {color:blue;}body {width:0px;margin:0px auto;}</style>' # noqa
17
-
18
- BASE_HTML = '''
19
- <html>
20
- <head>
21
- %s
22
- </head>
23
- <body>%%s</body>
24
- </html>
25
- ''' % STYLE
26
-
27
16
28
17
def test_extract_html ():
29
18
file_path = path .join (
You can’t perform that action at this time.
0 commit comments