Files
curriculum/1.solar-system/3.strings/04.the-validator/testing/test_solution.py

42 lines
826 B
Python

from solution import validate
def test_strong_password():
r = validate("Andromeda1")
assert r == {
"length": 10,
"long_enough": True,
"starts_capital": True,
"ends_digit": True,
}
def test_short_lowercase_no_digit():
r = validate("abc")
assert r == {
"length": 3,
"long_enough": False,
"starts_capital": False,
"ends_digit": False,
}
def test_capital_no_digit():
r = validate("Hello")
assert r == {
"length": 5,
"long_enough": False,
"starts_capital": True,
"ends_digit": False,
}
def test_long_lowercase_with_digit():
r = validate("spaceX2026")
assert r == {
"length": 10,
"long_enough": True,
"starts_capital": False,
"ends_digit": True,
}