-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add forward-compatibility with Pillow 8.0.0
- Loading branch information
Hugo Osvaldo Barrera
committed
Aug 14, 2020
1 parent
23a4388
commit 261984c
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
from io import BytesIO | ||
|
||
from barcode import EAN13 | ||
from barcode.writer import ImageWriter | ||
from barcode.writer import SVGWriter | ||
|
||
|
||
PATH = os.path.dirname(os.path.abspath(__file__)) | ||
TESTPATH = os.path.join(PATH, "test_outputs") | ||
|
||
if ImageWriter: | ||
|
||
def test_saving_image_to_byteio(): | ||
rv = BytesIO() | ||
EAN13(str(100000902922), writer=ImageWriter()).write(rv) | ||
|
||
with open(f"{TESTPATH}/somefile.jpeg", "wb") as f: | ||
EAN13("100000011111", writer=ImageWriter()).write(f) | ||
|
||
|
||
def test_saving_svg_to_byteio(): | ||
rv = BytesIO() | ||
EAN13(str(100000902922), writer=SVGWriter()).write(rv) | ||
|
||
with open(f"{TESTPATH}/somefile.svg", "wb") as f: | ||
EAN13("100000011111", writer=SVGWriter()).write(f) |