2121import time
2222import tempfile
2323import unittest
24- import uuid
2524from pathlib import Path
2625from subprocess import PIPE , STDOUT
2726
@@ -2688,15 +2687,15 @@ def clean(txt):
26882687 # verify '--separate-metadata' option produces separate metadata file
26892688 os .chdir ('..' )
26902689
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' ])
26922691 self .assertExists ('immutable.js.metadata' )
26932692 # verify js output JS file is not touched when the metadata is separated
26942693 orig_timestamp = os .path .getmtime ('immutable.js' )
26952694 orig_content = read_file ('immutable.js' )
26962695 # ensure some time passes before running the packager again so that if it does touch the
26972696 # js file it will end up with the different timestamp.
26982697 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' ])
27002699 # assert both file content and timestamp are the same as reference copy
27012700 self .assertTextDataIdentical (orig_content , read_file ('immutable.js' ))
27022701 self .assertEqual (orig_timestamp , os .path .getmtime ('immutable.js' ))
@@ -2707,8 +2706,7 @@ def clean(txt):
27072706 assert metadata ['files' ][1 ]['start' ] == len ('data1' ) and metadata ['files' ][1 ]['end' ] == len ('data1' ) + len ('data2' ) and metadata ['files' ][1 ]['filename' ] == '/subdir/data2.txt'
27082707 assert metadata ['remote_package_size' ] == len ('data1' ) + len ('data2' )
27092708
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' )
27122710
27132711 def test_file_packager_unicode (self ):
27142712 unicode_name = 'unicode…☃'
0 commit comments