@@ -1483,8 +1483,9 @@ def dict_set_path(dict_, *items):
1483
1483
for path in paths :
1484
1484
print (path )
1485
1485
for ext in extensions :
1486
- path2 = f'foo{ ext } '
1487
- shutil .copy2 (f'{ root } /{ path } ' , path2 )
1486
+ path2 = f'{ root } /foo{ ext } '
1487
+ path3 = shutil .copy2 (f'{ root } /{ path } ' , path2 )
1488
+ assert (path3 == path2 )
1488
1489
1489
1490
# Test fz_open_document().
1490
1491
e = None
@@ -1495,7 +1496,7 @@ def dict_set_path(dict_, *items):
1495
1496
e = ee
1496
1497
wt = pymupdf .TOOLS .mupdf_warnings ()
1497
1498
text = get_result (e , document )
1498
- print (f' fz_open_document({ path2 } ) => { text } ' )
1499
+ print (f' fz_open_document({ path2 } ) => { text } ' )
1499
1500
dict_set_path (results , path , ext , 'file' , text )
1500
1501
1501
1502
# Test fz_open_document_with_stream().
@@ -1521,6 +1522,7 @@ def dict_set_path(dict_, *items):
1521
1522
with open (path_html , 'w' ) as f :
1522
1523
f .write (f'<html>\n ' )
1523
1524
f .write (f'<body>\n ' )
1525
+ f .write (f'<p>{ time .strftime ("%F-%T" )} \n ' )
1524
1526
f .write (f'<table border="1" style="border-collapse:collapse" cellpadding="4">\n ' )
1525
1527
f .write (f'<tr><td></td><th colspan="{ len (extensions )} ">Extension/magic' )
1526
1528
f .write (f'<tr><th style="border-bottom: 4px solid black; border-right: 4px solid black;">Data file</th>' )
@@ -1540,18 +1542,21 @@ def dict_set_path(dict_, *items):
1540
1542
else :
1541
1543
f .write (f'<td>{ b1 } { text_file } { b2 } </td>' )
1542
1544
else :
1543
- f .write (f'<td>file: { b1 } { text_file } { b2 } </td>< br>' )
1544
- f .write (f'<td> stream: { b1 } { text_stream } { b2 } </td>' )
1545
+ f .write (f'<td>file: { b1 } { text_file } { b2 } <br>' )
1546
+ f .write (f'stream: { b1 } { text_stream } { b2 } </td>' )
1545
1547
f .write ('</tr>\n ' )
1546
1548
f .write (f'</table>\n ' )
1547
1549
f .write (f'/<body>\n ' )
1548
1550
f .write (f'</html>\n ' )
1549
1551
print (f'Have created: { path_html } ' )
1550
1552
1551
- with open (os .path .normpath (f'{ __file__ } /../../tests/resources/test_open2_expected.json' )) as f :
1552
- results_expected = json .load (f )
1553
-
1553
+ path_out = os .path .normpath (f'{ __file__ } /../../tests/test_open2.json' )
1554
+ with open (path_out , 'w' ) as f :
1555
+ json .dump (results , f , indent = 4 , sort_keys = 1 )
1556
+
1554
1557
if pymupdf .mupdf_version_tuple >= (1 , 26 ):
1558
+ with open (os .path .normpath (f'{ __file__ } /../../tests/resources/test_open2_expected.json' )) as f :
1559
+ results_expected = json .load (f )
1555
1560
if results != results_expected :
1556
1561
print (f'results != results_expected:' )
1557
1562
def show (r , name ):
0 commit comments