Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions

Question

Explain the various collection policies in receivables management.

Answered: 1 week ago

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago

Question

2. Identify conflict triggers in yourself and others

Answered: 1 week ago