mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: make qt image test work on python3
QByteArrays are natively bytes and ended up looking like this: u"b'xpm'" Instead use the builtin method to get the data back, and decode it to unicode.
This commit is contained in:
parent
727e65a203
commit
6d6509df57
@ -175,7 +175,7 @@ class BuildTest(unittest.TestCase):
|
||||
# it should just work because the hard-coded paths of the Qt
|
||||
# installation should work. If they do not, then it is a distro
|
||||
# problem.
|
||||
fmts = set(map(unicode_type, QImageReader.supportedImageFormats()))
|
||||
fmts = set(map(lambda x: x.data().decode('utf-8'), QImageReader.supportedImageFormats()))
|
||||
testf = {'jpg', 'png', 'svg', 'ico', 'gif'}
|
||||
self.assertEqual(testf.intersection(fmts), testf, "Qt doesn't seem to be able to load some of its image plugins. Available plugins: %s" % fmts)
|
||||
data = P('images/blank.png', allow_user_override=False, data=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user