Skip to content

Commit

Permalink
Not very secure
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 10, 2024
1 parent 62fab8f commit 8123d6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions kyu_5/not_very_secure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Not very secure."""
7 changes: 5 additions & 2 deletions kyu_5/not_very_secure/alphanumeric.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""
Solution for -> Not very secure
Solution for -> Not very secure.
Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""


def alphanumeric(password: str) -> bool:
"""
alphanumeric function.
The string has the following conditions to be alphanumeric:
1. At least one character ("" is not valid)
Expand All @@ -20,7 +23,7 @@ def alphanumeric(password: str) -> bool:
:return: bool
"""

if password == "":
if not password:
return False

for char in password:
Expand Down
10 changes: 4 additions & 6 deletions kyu_5/not_very_secure/test_alphanumeric.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Test for -> Not very secure
Test for -> Not very secure.
Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""
Expand Down Expand Up @@ -31,14 +32,11 @@
name='Source/Kata')
# pylint: enable-msg=R0801
class AlphanumericTestCase(unittest.TestCase):
"""
Testing alphanumeric function
"""
"""Testing alphanumeric function."""

def test_alphanumeric(self):
"""
Testing alphanumeric function with
various test inputs
Testing alphanumeric function with various test inputs.
The string has the following conditions
to be alphanumeric only
Expand Down

0 comments on commit 8123d6b

Please sign in to comment.