mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
67e82c25e1
commit
ab11e8f878
@ -159,6 +159,7 @@ def encode_jpeg(file_path, quality=80):
|
||||
def test():
|
||||
from calibre.ptempfile import TemporaryDirectory
|
||||
from calibre import CurrentDir
|
||||
from glob import glob
|
||||
with TemporaryDirectory() as tdir, CurrentDir(tdir):
|
||||
shutil.copyfile(I('devices/kindle.jpg'), 'test.jpg')
|
||||
ret = optimize_jpeg('test.jpg')
|
||||
@ -171,3 +172,5 @@ def test():
|
||||
ret = optimize_png('test.png')
|
||||
if ret is not None:
|
||||
raise SystemExit('optimize_png failed: %s' % ret)
|
||||
if glob('*.bak'):
|
||||
raise SystemExit('Spurious .bak files left behind')
|
||||
|
Loading…
x
Reference in New Issue
Block a user