def test_code128_image(self): # use the same font etc as is in use with squash_barcodes font = join(dirname(realpath(knimin.lib.__file__)), 'FreeSans.ttf') im = code128_image('000001234', height=100, width=202, thickness=2, show_text=True, quiet_zone=False, font=font) self.assertEqual(im.height, 100) self.assertEqual(im.width, 202)
def get_image(barcodes): font = join(dirname(realpath(__file__)), 'FreeSans.ttf') for b in barcodes: yield code128_image(b, height=100, width=202, font=font, thickness=2, show_text=True, quiet_zone=False)
def mock_get_image2(barcodes): font = join(dirname(realpath(__file__)), '../', 'FreeSans.ttf') for b in barcodes: yield code128_image(b, height=150, width=303, font=font, thickness=2, show_text=True, quiet_zone=False)
def get_image(barcodes): font = join(dirname(realpath(__file__)), "FreeSans.ttf") for b in barcodes: yield code128_image(b, height=100, width=202, font=font, thickness=2, show_text=True, quiet_zone=False)