Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Pytest script for the following functions: def login(): global users count = 0 while True: userName = input('Login: ') password = input('Password: ')
Create a Pytest script for the following functions:
def login():
global users count = 0 while True: userName = input('Login: ') password = input('Password: ') currentUser = validateUser(userName, password) if currentUser is not None: break print('Incorrect login. Try Again.') failedLogin(userName) count = count + 1 if (count > 4): count = 0 print('Too many failed attempts, System locking down') lockedSystemReport(userName) timex.sleep(3600) if not validateAccessTime(currentUser): print('You are not within range of your access time. Try again later.') exit() print('Logged in successfully. ') loginReport(userName) checkPasswordExpiration(currentUser) return currentUser
def changePassword(user):
currPass = input('Enter your current password: ') if not decrypt(user) == currPass: print('Incorrect password. ') return newPass = input('Enter your new password: ') if user.searchOldPasswords(newPass): print('Cannot reuse old password. ') return while not validatePassword(newPass): newPass = input(' Enter your new password: ') if user.searchOldPasswords(newPass): print('Cannot reuse old password. ') return confirmPass = input('Re-enter your new password: ') if not newPass == confirmPass: print("Passwords do not match. ") return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started