From b82229245a7d1ea06270df6c1b5c69dcdbdcdd44 Mon Sep 17 00:00:00 2001 From: Pieter Marsman Date: Sun, 23 Jan 2022 21:00:13 +0100 Subject: [PATCH] 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 --- tests/test_pdfminer_ccitt.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_pdfminer_ccitt.py b/tests/test_pdfminer_ccitt.py index 4dbf36f..412bbae 100644 --- a/tests/test_pdfminer_ccitt.py +++ b/tests/test_pdfminer_ccitt.py @@ -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