Question: Please note that Exercise 3 requires that you create 2 programs: my_password_module . use_my_password_module my_password_module is a container for password vandation functions that will

Please note that Exercise 3 requires that you create 2 programs: my_password_module  

. use_my_password_module my_password_module is a container for password vandation functions that will

be used by other programs. The module should contain the following validation

Please note that Exercise 3 requires that you create 2 programs: my_password_module . use_my_password_module my_password_module is a container for password vandation functions that will be used by other programs. The module should contain the following validation function: validate_password() The code in validate_password() should include all code demonstrated in the Part 3 tutorial video plus additional code that implements the following requirements: 1 Password may not contain the word "password" in any case. 2 Password may not contain the word "secret" in any case Please be sure to code all strings used as regular expression patterns using Python raw strings. my_password_module should also include a main() function that will contain unit testing code. Your code should include all unit test code demonstrated in the Part 3 tutorial video plus enough additional unit test cases to fully test the additional requirements introduced above. Since your version of my password module is an enhancement of the code demonstrated in the Part 3 tutorial video, you should use the unit testing code from that video as your starting point. When you add further unit testing code, use my approach from the tutorial video as your model. When this module is run by itself (not when it is imported), the console session should look like this: Unit testing output... D Test case 1: password too short When this module is run by itself (not when it is imported), the console session should look like this: Unit testing output... Test case 1: password too short passed Test case 2: password meets all criteri passed Test case 3: password missing upper case letter passed Test case 4: password missing lower-case letter passed Test case 5: password missing special character passed Test case 6: password missing multiple of the criteria passed Test case 7: password contains word password passed Test case 8: password contains word secret pageed Page 5 of 8 def validate_password (candidate): error_messages = [] # returning empty List indicates password is valid if len(candidate) < 6: error_messages.append('Password must be at least 6 characters long.') if not re.search(r' [A-Z]', candidate): error_messages.append('Password must include at least one upper-case letter (A-Z).') if not re.search(r' [a-z]', candidate): error_messages.append('Password must include at least one lower-case letter (a-z).') if not re.search(r' [!@#$%^&*]', candidate): error_messages.append('Password must include at least one lower-case letter (!@#$%^&*).') return error_messages def main(): print('Unit testing output...') main() if actual_result == expected_re...

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

code for mypasswordmodule python import re def validatepasswordcandidate Validates a password Args candidate The password to validate Returns A list o... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!