11import io
22import re
33
4+ import pytest
5+
46import pydyf
57
68from . import assert_pixels
79
810
9- def test_fill ():
11+ @pytest .mark .parametrize ("compress" , [False , True ])
12+ def test_fill (compress ):
1013 document = pydyf .PDF ()
1114
1215 draw = pydyf .Stream ()
@@ -32,7 +35,7 @@ def test_fill():
3235 __KKKKK___
3336 __________
3437 __________
35- ''' )
38+ ''' , compress )
3639
3740
3841def test_stroke ():
@@ -705,30 +708,33 @@ def test_text():
705708 ''' )
706709
707710
708- def test_no_identifier ():
711+ @pytest .mark .parametrize ("compress" , [False , True ])
712+ def test_no_identifier (compress ):
709713 document = pydyf .PDF ()
710714 pdf = io .BytesIO ()
711- document .write (pdf , identifier = False )
715+ document .write (pdf , compress = compress , identifier = False )
712716 assert re .search (
713717 b'/ID \\ [\\ ((?P<hash>[0-9a-f]{32})\\ ) \\ ((?P=hash)\\ )\\ ]' ,
714718 pdf .getvalue ()
715719 ) is None
716720
717721
718- def test_default_identifier ():
722+ @pytest .mark .parametrize ("compress" , [False , True ])
723+ def test_default_identifier (compress ):
719724 document = pydyf .PDF ()
720725 pdf = io .BytesIO ()
721- document .write (pdf , identifier = True )
726+ document .write (pdf , compress = compress , identifier = True )
722727 assert re .search (
723728 b'/ID \\ [\\ ((?P<hash>[0-9a-f]{32})\\ ) \\ ((?P=hash)\\ )\\ ]' ,
724729 pdf .getvalue ()
725730 ) is not None
726731
727732
728- def test_custom_identifier ():
733+ @pytest .mark .parametrize ("compress" , [False , True ])
734+ def test_custom_identifier (compress ):
729735 document = pydyf .PDF ()
730736 pdf = io .BytesIO ()
731- document .write (pdf , identifier = b'abc' )
737+ document .write (pdf , compress = compress , identifier = b'abc' )
732738 assert re .search (
733739 b'/ID \\ [\\ (abc\\ ) \\ (([0-9a-f]{32})\\ )\\ ]' ,
734740 pdf .getvalue ()
0 commit comments