Skip to content

Commit

Permalink
Update test_encrypt_non_standard_characters with new values
Browse files Browse the repository at this point in the history
  • Loading branch information
zywkloo committed Jan 31, 2024
1 parent 39a25c5 commit 82df255
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/passwordler/_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

accented_chars = ['á', 'à', 'â', 'ä', 'ã', 'å', 'æ', 'ç', 'é', 'è', 'ê', 'ë', 'í',
'ì', 'î', 'ï', 'ñ', 'ó', 'ò', 'ô', 'ö', 'õ', 'ø', 'œ', 'ú', 'ù', 'û', 'ü', 'ý', 'ÿ']
original = accented_chars + string.ascii_letters + \
string.digits + string.punctuation
string_builtin_chars = string.ascii_letters + string.digits + string.punctuation

# Combine the lists
original = accented_chars + list(string_builtin_chars)

def getKeyMap(shuffled, isDecryption=False):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_encrypt_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def test_encrypt_non_standard_characters():
Test that non-standard characters (not in the original character set)
are unchanged in the encrypted message.
"""
message = "test~`**^"
message = "test \t\n\r\x0b\x0c"
encrypted = encrypt_password(message, 123)
print(encrypted)

assert all(char in encrypted for char in "~`**^")
assert all(char in encrypted for char in " \t\n\r\x0b\x0c")
4 changes: 3 additions & 1 deletion tests/test_generate_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_generate_password_include_numbers():
"""
Test if the generated password includes numbers.
"""
assert any(char in generate_password(12, include_numbers=True) for char in "0123456789")
ret = generate_password(12, include_numbers=True)
print(ret)
assert any(char in ret for char in "0123456789")

def test_generate_password_strength():
"""
Expand Down

0 comments on commit 82df255

Please sign in to comment.