"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_pdfgen_general.py" between
reportlab-3.5.65.tar.gz and reportlab-3.5.66.tar.gz

About: ReportLab generates high-quality dynamic PDF documents/charts in real-time & high volumes from any data source (commercial version also available). f: office t: PDF report "data graphics" charts

test_pdfgen_general.py  (reportlab-3.5.65):test_pdfgen_general.py  (reportlab-3.5.66)
skipping to change at line 1228 skipping to change at line 1228
def testOSFile(self): def testOSFile(self):
import io import io
fd = os.open(outputfile('test_pdfgen_osfile.pdf'),getattr(os,'O_BINARY', 0)|os.O_WRONLY|os.O_CREAT) fd = os.open(outputfile('test_pdfgen_osfile.pdf'),getattr(os,'O_BINARY', 0)|os.O_WRONLY|os.O_CREAT)
fn = io.FileIO(fd,'wb') fn = io.FileIO(fd,'wb')
c = canvas.Canvas(fn) c = canvas.Canvas(fn)
c.drawString(100, 700, 'Hello World my filedescriptor is %d!' % fd) c.drawString(100, 700, 'Hello World my filedescriptor is %d!' % fd)
c.showPage() c.showPage()
c.save() c.save()
def testSpooledTemporarySaves(self):
return
from tempfile import SpooledTemporaryFile
with SpooledTemporaryFile() as f:
c = canvas.Canvas(f)
c.drawString(100, 700, 'Hello World I write to %s' % repr(f))
c.showPage()
c.save()
def testBytesIOSaves(self):
from io import BytesIO
with BytesIO() as f:
c = canvas.Canvas(f)
c.drawString(100, 700, 'Hello World I write to %s' % repr(f))
c.showPage()
c.save()
def testBadFileName(self):
f = ['filename']
c = canvas.Canvas(f)
c.drawString(100, 700, 'Hello World I write to %s' % repr(f))
c.showPage()
self.assertRaises(TypeError,c.save)
def trySomeColors(C,enforceColorSpace=None): def trySomeColors(C,enforceColorSpace=None):
from reportlab.lib.utils import getBytesIO from reportlab.lib.utils import getBytesIO
out=getBytesIO() out=getBytesIO()
canv = canvas.Canvas(out,enforceColorSpace=enforceColorSpace) canv = canvas.Canvas(out,enforceColorSpace=enforceColorSpace)
canv.setFont('Helvetica',10) canv.setFont('Helvetica',10)
x = 0 x = 0
y = 0 y = 0
w,h = canv._pagesize w,h = canv._pagesize
for c in C: for c in C:
if y+10>h: if y+10>h:
 End of changes. 1 change blocks. 
0 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)