Added test case for CCITTFaxDecoder (#700)

* array.array.tostring -> array.array.tobytes

The tostring method has been deprecated since Python 3.2 and was
removed altogether in 3.9. In Python 3.2 the method was renamed
to "tobytes"

Will close #641

* changelog entry

* test for tobytes

* Fix CHANGELOG.md

* Update CHANGELOG.md to PR that I can push on

* Simplify tests

Co-authored-by: Forest Gregg <fgregg@uchicago.edu>
pull/659/head^2
Pieter Marsman 2022-01-23 21:00:13 +01:00 committed by GitHub
parent 10f6fb40c2
commit b82229245a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
from nose.tools import assert_equal
from pdfminer.ccitt import CCITTG4Parser
from pdfminer.ccitt import CCITTG4Parser, CCITTFaxDecoder
class TestCCITTG4Parser():
@ -153,3 +153,11 @@ class TestCCITTG4Parser():
parser._do_vertical(1)
assert_equal(parser._get_bits(), '00000001')
return
class TestCCITTFaxDecoder:
def test_b1(self):
decoder = CCITTFaxDecoder(5)
decoder.output_line(0, b'0')
assert_equal(decoder.close(), b'\x80')
return