Question: i need 4 more test case so i can find the bug in file scope.py Scope ACTIVITY Download the files scope .py and test_scope.py from

 i need 4 more test case so i can find thebug in file scope.py Scope ACTIVITY Download the files scope .py andtest_scope.py from Labo2 on Moodle. Study the code in both files. Runthe test script. Observe the errors! Don't fix them yet. Add atleast 4 new test cases to the test script. Re-order your tests.

i need 4 more test case so i can find the bug in file scope.py Scope ACTIVITY Download the files scope .py and test_scope.py from Labo2 on Moodle. Study the code in both files. Run the test script. Observe the errors! Don't fix them yet. Add at least 4 new test cases to the test script. Re-order your tests. You'll get different reports! Copy/paste the output of your test script, showing errors to the lab02-transcript.txt file. #scope.py def find_duplicates (alist): Purpose: Return a list of duplicate values found in alist. Pre: alist: a list of values Post: None Return: A list of duplicates from alist uniques = [1] for item in alist: if item in uniques: duplicates.append(item) else: uniques.append(item) return duplicates # global variable duplicates = 0 # test_scope.pl import scope as scope # test case inputs = [] expected - [] reason = 'Empty list' result - scope.find_duplicates (inputs) if result != expected: print('Error in find_duplicates: expected', expected, but obtained', result, '--', reason) # test case inputs - [1] expected - [] reason = 'Singleton list' result - scope.find_duplicates(inputs) if result != expected: print('Error in find_duplicates: expected', expected, 'but obtained', result, '--', reason) # test case inputs = [1, 1] expected - [1] reason - 'Simplest list with a duplicate result - scope. find_duplicates (inputs) if result != expected: print('Error in find_duplicates: expected", expected, 'but obtained', result, '--', reason) # test case inputs = [1, 2, 3] expected - [] reason - 'Longer list with no duplicates' result = scope.find_duplicates (inputs) if result != expected: print('Error in find_duplicates: expected', expected, "but obtained', result, '--', reason) print("*** Test script finished ***')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!