Skip to content

Commit

Permalink
Merge pull request #86 from UBC-MDS/add_function_examples
Browse files Browse the repository at this point in the history
fix: Add function examples
  • Loading branch information
rorywhite200 authored Jan 31, 2024
2 parents 435908b + da9cd77 commit 1cb1457
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/passwordler/decrypt_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def decrypt_password(encrypted_message, random_seed = 123):
seed is utilized to maintain consistent decryption results when needed.
Example:
>>> encrypted = encrypt_password('Monty Python', random_seed = 123)
>>> decrypted = decrypt_password(encrypted, random_seed = 123)
>>> original_message = 'Monty Python'
>>> encrypted_message = encrypt_password(original_message, random_seed = 123)
>>> decrypted_message = decrypt_password(encrypted_message, random_seed = 123)
Output: 'Monty Python'
"""
if not isinstance(encrypted_message, str):
raise TypeError(
Expand Down
6 changes: 6 additions & 0 deletions src/passwordler/generate_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ def generate_password(length=12, include_symbols=True, include_numbers=True):
Returns:
str: A randomly generated password.
Example:
>>> generate_password()
Output: ',tKC]m"wDJ34'
>>> generate_password(include_symbols=False, include_numbers=False)
Output: 'NJfVKhgnrJYa'
"""

if not isinstance(length, int):
Expand Down
6 changes: 6 additions & 0 deletions src/passwordler/password_strength.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def password_strength(password):
Returns:
str: a rating of either 'weak', 'good' or 'strong'
Example:
>>> password_strength('baseball')
Output: 'Your password is: Weak'
>>> password_strength('Baseball4life!')
Output: 'Your password is: Strong'
"""
if not isinstance(password, str):
raise TypeError("'password' should be of type 'string'")
Expand Down

0 comments on commit 1cb1457

Please sign in to comment.