Skip to content

Commit

Permalink
Add test to cover bz.avail_out == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
desvxx committed Sep 28, 2024
1 parent 7724682 commit d475776
Show file tree
Hide file tree
Showing 2 changed files with 10,897 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4730,6 +4730,32 @@ def test_rnp_compression(self):
file_encryption_rnp_to_gpg(size, z)
rnp_signing_gpg_to_rnp(size, z)

def test_rnp_compression_corner_cases(self):
shutil.rmtree(RNPDIR)
kring = shutil.copytree(data_path(KEYRING_DIR_1), RNPDIR)
gpg_import_pubring()
gpg_import_secring()

algosrnp = [None, 'zip', 'zlib', 'bzip2']

for algo in algosrnp:
z = [algo, None]
src = data_path('test_compression/cleartext-z-bz.txt')
dst, enc = reg_workfiles('cleartext', '.gpg', '.rnp')
for armor in [False, True]:
# Encrypt cleartext file with RNP
rnp_encrypt_file_ex(src, enc, [], None, None, None, z, armor)

# Decrypt encrypted file with GPG
gpg_decrypt_file(enc, dst, PASSWORD)
compare_files(src, dst, GPG_DATA_DIFFERS)
remove_files(dst)
# Decrypt encrypted file with RNP
rnp_decrypt_file(enc, dst)
compare_files(src, dst, RNP_DATA_DIFFERS)
remove_files(enc, dst)
clear_workfiles()

class SignDefault(unittest.TestCase):
'''
Things to try later:
Expand Down
Loading

0 comments on commit d475776

Please sign in to comment.