mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
test the accuracy of the font file conversion
This commit is contained in:
parent
7a5d215022
commit
ebb0a491b6
BIN
Tests/fonts/10x20.pbm
Normal file
BIN
Tests/fonts/10x20.pbm
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
Tests/fonts/10x20.pil
Normal file
BIN
Tests/fonts/10x20.pil
Normal file
Binary file not shown.
|
@ -26,6 +26,14 @@ class TestFontPcf(PillowTestCase):
|
||||||
tempname = self.tempfile("temp.pil")
|
tempname = self.tempfile("temp.pil")
|
||||||
self.addCleanup(self.delete_tempfile, tempname[:-4]+'.pbm')
|
self.addCleanup(self.delete_tempfile, tempname[:-4]+'.pbm')
|
||||||
font.save(tempname)
|
font.save(tempname)
|
||||||
|
|
||||||
|
with Image.open(tempname.replace('.pil', '.pbm')) as loaded:
|
||||||
|
with Image.open('Tests/fonts/10x20.pbm') as target:
|
||||||
|
self.assert_image_equal(loaded, target)
|
||||||
|
|
||||||
|
with open(tempname, 'rb') as f_loaded:
|
||||||
|
with open('Tests/fonts/10x20.pil', 'rb') as f_target:
|
||||||
|
self.assertEqual(f_loaded.read(), f_target.read())
|
||||||
return tempname
|
return tempname
|
||||||
|
|
||||||
def test_sanity(self):
|
def test_sanity(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user