diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-30 10:46:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-30 10:46:54 -0800 |
commit | 01b837d0ad97a01d0d46f518215b85a1b87ba9c3 (patch) | |
tree | a453218b566486aed0287244bf0ef619087c8e84 /tests | |
parent | 4bf76193c6f3f5d4c0a83ef2e715210b3d375175 (diff) |
fix other.test_crunch
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_other.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index 43bd3025..1986582b 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1950,19 +1950,19 @@ seeked= file. # crunch should not be run if a .crn exists that is more recent than the .dds shutil.copyfile(path_from_root('tests', 'ship.dds'), 'ship.dds') time.sleep(0.1) - Popen([PYTHON, FILE_PACKAGER, 'test.data', '--pre-run', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() + Popen([PYTHON, FILE_PACKAGER, 'test.data', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() assert os.stat('test.data').st_size < 0.25*os.stat('ship.dds').st_size, 'Compressed should be much smaller than dds' crunch_time = os.stat('ship.crn').st_mtime dds_time = os.stat('ship.dds').st_mtime assert crunch_time > dds_time, 'Crunch is more recent' # run again, should not recrunch! time.sleep(0.1) - Popen([PYTHON, FILE_PACKAGER, 'test.data', '--pre-run', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() + Popen([PYTHON, FILE_PACKAGER, 'test.data', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() assert crunch_time == os.stat('ship.crn').st_mtime, 'Crunch is unchanged' # update dds, so should recrunch time.sleep(0.1) os.utime('ship.dds', None) - Popen([PYTHON, FILE_PACKAGER, 'test.data', '--pre-run', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() + Popen([PYTHON, FILE_PACKAGER, 'test.data', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() assert crunch_time < os.stat('ship.crn').st_mtime, 'Crunch was changed' def test_headless(self): |