mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Use fp instead of filename
This commit is contained in:
parent
385ad47a9b
commit
6da05b4026
|
@ -12,13 +12,14 @@ class TestPsDraw(PillowTestCase):
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL import PSDraw
|
from PIL import PSDraw
|
||||||
tempfile = self.tempfile('temp.ps')
|
tempfile = self.tempfile('temp.ps')
|
||||||
|
fp = open(tempfile, "wb")
|
||||||
|
|
||||||
im = Image.open("Tests/images/hopper.ppm")
|
im = Image.open("Tests/images/hopper.ppm")
|
||||||
title = "hopper"
|
title = "hopper"
|
||||||
box = (1*72, 2*72, 7*72, 10*72) # in points
|
box = (1*72, 2*72, 7*72, 10*72) # in points
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
ps = PSDraw.PSDraw(tempfile)
|
ps = PSDraw.PSDraw(fp)
|
||||||
ps.begin_document(title)
|
ps.begin_document(title)
|
||||||
|
|
||||||
# draw the image (75 dpi)
|
# draw the image (75 dpi)
|
||||||
|
@ -31,6 +32,7 @@ class TestPsDraw(PillowTestCase):
|
||||||
ps.text((4*72-w/2, 1*72-h), title)
|
ps.text((4*72-w/2, 1*72-h), title)
|
||||||
|
|
||||||
ps.end_document()
|
ps.end_document()
|
||||||
|
fp.close()
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
# TODO
|
# TODO
|
||||||
|
|
Loading…
Reference in New Issue
Block a user