Skip to content

Commit 503b82c

Browse files
author
Jason Ward
committed
refs #29: updated white space
1 parent 0cec158 commit 503b82c

File tree

1 file changed

+72
-79
lines changed

1 file changed

+72
-79
lines changed

pydocx/tests/test_xml.py

Lines changed: 72 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
class BoldTestCase(_TranslationTestCase):
1717
expected_output = """
18-
<p><b>AAA</b></p>
19-
<p>BBB</p>
18+
<p><b>AAA</b></p>
19+
<p>BBB</p>
2020
"""
2121

2222
def get_xml(self):
@@ -74,8 +74,7 @@ class HyperlinkNoTextTestCase(_TranslationTestCase):
7474
'rId0': 'www.google.com',
7575
}
7676

77-
expected_output = '''
78-
'''
77+
expected_output = ''
7978

8079
def get_xml(self):
8180
run_tags = []
@@ -90,9 +89,7 @@ class HyperlinkNotInRelsDictTestCase(_TranslationTestCase):
9089
# 'rId0': 'www.google.com', missing
9190
}
9291

93-
expected_output = '''
94-
<p>link.</p>
95-
'''
92+
expected_output = '<p>link.</p>'
9693

9794
def get_xml(self):
9895
run_tags = []
@@ -109,9 +106,7 @@ class HyperlinkWithBreakTestCase(_TranslationTestCase):
109106
'rId0': 'www.google.com',
110107
}
111108

112-
expected_output = '''
113-
<p><a href="www.google.com">link<br/></a></p>
114-
'''
109+
expected_output = '<p><a href="www.google.com">link<br/></a></p>'
115110

116111
def get_xml(self):
117112
run_tags = []
@@ -129,12 +124,12 @@ class ImageTestCase(_TranslationTestCase):
129124
'rId1': 'media/image2.jpeg',
130125
}
131126
expected_output = '''
132-
<p>
133-
<img src="media/image1.jpeg" height="20px" width="40px" />
134-
</p>
135-
<p>
136-
<img src="media/image2.jpeg" height="21pt" width="41pt" />
137-
</p>
127+
<p>
128+
<img src="media/image1.jpeg" height="20px" width="40px" />
129+
</p>
130+
<p>
131+
<img src="media/image2.jpeg" height="21pt" width="41pt" />
132+
</p>
138133
'''
139134

140135
def get_xml(self):
@@ -202,8 +197,7 @@ class ImageNotInRelsDictTestCase(_TranslationTestCase):
202197
relationship_dict = {
203198
# 'rId0': 'media/image1.jpeg',
204199
}
205-
expected_output = '''
206-
'''
200+
expected_output = ''
207201

208202
def get_xml(self):
209203
drawing = DXB.drawing(height=20, width=40, r_id='rId0')
@@ -255,16 +249,16 @@ def get_xml(self):
255249

256250
class TableTag(_TranslationTestCase):
257251
expected_output = '''
258-
<table border="1">
259-
<tr>
260-
<td>AAA</td>
261-
<td>BBB</td>
262-
</tr>
263-
<tr>
264-
<td>CCC</td>
265-
<td>DDD</td>
266-
</tr>
267-
</table>
252+
<table border="1">
253+
<tr>
254+
<td>AAA</td>
255+
<td>BBB</td>
256+
</tr>
257+
<tr>
258+
<td>CCC</td>
259+
<td>DDD</td>
260+
</tr>
261+
</table>
268262
'''
269263

270264
def get_xml(self):
@@ -324,16 +318,16 @@ def get_xml(self):
324318

325319
class TableWithInvalidTag(_TranslationTestCase):
326320
expected_output = '''
327-
<table border="1">
328-
<tr>
329-
<td>AAA</td>
330-
<td>BBB</td>
331-
</tr>
332-
<tr>
333-
<td></td>
334-
<td>DDD</td>
335-
</tr>
336-
</table>
321+
<table border="1">
322+
<tr>
323+
<td>AAA</td>
324+
<td>BBB</td>
325+
</tr>
326+
<tr>
327+
<td></td>
328+
<td>DDD</td>
329+
</tr>
330+
</table>
337331
'''
338332

339333
def get_xml(self):
@@ -392,11 +386,11 @@ def get_xml(self):
392386

393387
class SimpleListTestCase(_TranslationTestCase):
394388
expected_output = '''
395-
<ol list-style-type="lowerLetter">
396-
<li>AAA</li>
397-
<li>BBB</li>
398-
<li>CCC</li>
399-
</ol>
389+
<ol list-style-type="lowerLetter">
390+
<li>AAA</li>
391+
<li>BBB</li>
392+
<li>CCC</li>
393+
</ol>
400394
'''
401395

402396
# Ensure its not failing somewhere and falling back to decimal
@@ -422,9 +416,9 @@ def get_xml(self):
422416

423417
class SingleListItemTestCase(_TranslationTestCase):
424418
expected_output = '''
425-
<ol list-style-type="lowerLetter">
426-
<li>AAA</li>
427-
</ol>
419+
<ol list-style-type="lowerLetter">
420+
<li>AAA</li>
421+
</ol>
428422
'''
429423

430424
# Ensure its not failing somewhere and falling back to decimal
@@ -448,22 +442,22 @@ def get_xml(self):
448442

449443
class ListWithContinuationTestCase(_TranslationTestCase):
450444
expected_output = '''
451-
<ol list-style-type="decimal">
452-
<li>AAA<br/>BBB</li>
453-
<li>CCC
454-
<table border="1">
455-
<tr>
456-
<td>DDD</td>
457-
<td>EEE</td>
458-
</tr>
459-
<tr>
460-
<td>FFF</td>
461-
<td>GGG</td>
462-
</tr>
463-
</table>
464-
</li>
465-
<li>HHH</li>
466-
</ol>
445+
<ol list-style-type="decimal">
446+
<li>AAA<br/>BBB</li>
447+
<li>CCC
448+
<table border="1">
449+
<tr>
450+
<td>DDD</td>
451+
<td>EEE</td>
452+
</tr>
453+
<tr>
454+
<td>FFF</td>
455+
<td>GGG</td>
456+
</tr>
457+
</table>
458+
</li>
459+
<li>HHH</li>
460+
</ol>
467461
'''
468462

469463
def get_xml(self):
@@ -490,21 +484,21 @@ def get_xml(self):
490484

491485
class ListWithMultipleContinuationTestCase(_TranslationTestCase):
492486
expected_output = '''
493-
<ol list-style-type="decimal">
494-
<li>AAA
495-
<table border="1">
496-
<tr>
497-
<td>BBB</td>
498-
</tr>
499-
</table>
500-
<table border="1">
501-
<tr>
502-
<td>CCC</td>
503-
</tr>
504-
</table>
505-
</li>
506-
<li>DDD</li>
507-
</ol>
487+
<ol list-style-type="decimal">
488+
<li>AAA
489+
<table border="1">
490+
<tr>
491+
<td>BBB</td>
492+
</tr>
493+
</table>
494+
<table border="1">
495+
<tr>
496+
<td>CCC</td>
497+
</tr>
498+
</table>
499+
</li>
500+
<li>DDD</li>
501+
</ol>
508502
'''
509503

510504
def get_xml(self):
@@ -616,8 +610,7 @@ def get_xml(self):
616610

617611

618612
class DeeplyNestedTableTestCase(_TranslationTestCase):
619-
expected_output = '''
620-
'''
613+
expected_output = ''
621614
run_expected_output = False
622615

623616
def get_xml(self):

0 commit comments

Comments
 (0)