Skip to content

Commit

Permalink
chore: add more coverage (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jan 12, 2024
1 parent 18a8b48 commit 7c8d36c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,13 @@ def test_encrypt_with_nulls():
== b"\x00\x00\x00\x0e\xdf\xb7\xde\xad\xad\xc5\xa4\xd7\xd7\xb9\xcc\xa0\xcc\xbf"
)
assert decrypt(encrypt(string_with_nulls)[4:]) == string_with_nulls


def test_encrypt_round_decreasing_size():
for i in range(0, 128):
payload = bytes([i] * i).decode()
assert decrypt(encrypt(payload)[4:]) == payload

for i in range(127, 0, -1):
payload = bytes([i] * i).decode()
assert decrypt(encrypt(payload)[4:]) == payload

0 comments on commit 7c8d36c

Please sign in to comment.