Skip to content

Commit 9329129

Browse files
desvxxni4
authored andcommitted
Add test to cover bz.avail_out == 0
1 parent 84975ea commit 9329129

File tree

2 files changed

+10205
-0
lines changed

2 files changed

+10205
-0
lines changed

src/tests/cli_tests.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,6 +4820,31 @@ def test_rnp_compression(self):
48204820
file_encryption_rnp_to_gpg(size, z)
48214821
rnp_signing_gpg_to_rnp(size, z)
48224822

4823+
def test_rnp_compression_corner_cases(self):
4824+
shutil.rmtree(RNPDIR)
4825+
kring = shutil.copytree(data_path(KEYRING_DIR_1), RNPDIR)
4826+
gpg_import_pubring()
4827+
gpg_import_secring()
4828+
4829+
src = data_path('test_compression/cleartext-z-bz.txt')
4830+
algosrnp = [None, 'zip', 'zlib', 'bzip2']
4831+
4832+
for algo in algosrnp:
4833+
z = [algo, None]
4834+
dst, enc = reg_workfiles('cleartext', '.gpg', '.rnp')
4835+
# Encrypt cleartext file with RNP
4836+
rnp_encrypt_file_ex(src, enc, [], None, None, None, z, False)
4837+
4838+
# Decrypt encrypted file with GPG
4839+
gpg_decrypt_file(enc, dst, PASSWORD)
4840+
compare_files(src, dst, GPG_DATA_DIFFERS)
4841+
remove_files(dst)
4842+
# Decrypt encrypted file with RNP
4843+
rnp_decrypt_file(enc, dst)
4844+
compare_files(src, dst, RNP_DATA_DIFFERS)
4845+
remove_files(enc, dst)
4846+
clear_workfiles()
4847+
48234848
class SignDefault(unittest.TestCase):
48244849
'''
48254850
Things to try later:

0 commit comments

Comments
 (0)