21
21
import time
22
22
import tempfile
23
23
import unittest
24
- import uuid
25
24
from pathlib import Path
26
25
from subprocess import PIPE , STDOUT
27
26
@@ -2688,15 +2687,15 @@ def clean(txt):
2688
2687
# verify '--separate-metadata' option produces separate metadata file
2689
2688
os .chdir ('..' )
2690
2689
2691
- self .run_process ([FILE_PACKAGER , 'test.data' , '--preload' , 'data1.txt' , '--preload' , 'subdir/data2.txt' , '--js-output=immutable.js' , '--separate-metadata' ])
2690
+ self .run_process ([FILE_PACKAGER , 'test.data' , '--preload' , 'data1.txt' , '--preload' , 'subdir/data2.txt' , '--js-output=immutable.js' , '--separate-metadata' , '--use-preload-cache' ])
2692
2691
self .assertExists ('immutable.js.metadata' )
2693
2692
# verify js output JS file is not touched when the metadata is separated
2694
2693
orig_timestamp = os .path .getmtime ('immutable.js' )
2695
2694
orig_content = read_file ('immutable.js' )
2696
2695
# ensure some time passes before running the packager again so that if it does touch the
2697
2696
# js file it will end up with the different timestamp.
2698
2697
time .sleep (1.0 )
2699
- self .run_process ([FILE_PACKAGER , 'test.data' , '--preload' , 'data1.txt' , '--preload' , 'subdir/data2.txt' , '--js-output=immutable.js' , '--separate-metadata' ])
2698
+ self .run_process ([FILE_PACKAGER , 'test.data' , '--preload' , 'data1.txt' , '--preload' , 'subdir/data2.txt' , '--js-output=immutable.js' , '--separate-metadata' , '--use-preload-cache' ])
2700
2699
# assert both file content and timestamp are the same as reference copy
2701
2700
self .assertTextDataIdentical (orig_content , read_file ('immutable.js' ))
2702
2701
self .assertEqual (orig_timestamp , os .path .getmtime ('immutable.js' ))
@@ -2707,8 +2706,7 @@ def clean(txt):
2707
2706
assert metadata ['files' ][1 ]['start' ] == len ('data1' ) and metadata ['files' ][1 ]['end' ] == len ('data1' ) + len ('data2' ) and metadata ['files' ][1 ]['filename' ] == '/subdir/data2.txt'
2708
2707
assert metadata ['remote_package_size' ] == len ('data1' ) + len ('data2' )
2709
2708
2710
- # can only assert the uuid format is correct, the uuid's value is expected to differ in between invocation
2711
- uuid .UUID (metadata ['package_uuid' ], version = 4 )
2709
+ self .assertEqual (metadata ['package_uuid' ], 'sha256-53ddc03623f867c7d4a631ded19c2613f2cb61d47b6aa214f47ff3cc15445bcd' )
2712
2710
2713
2711
def test_file_packager_unicode (self ):
2714
2712
unicode_name = 'unicode…☃'
0 commit comments