0
0
Testing Fundamentalstesting~10 mins

Building a testing portfolio in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a new test case to your portfolio list.

Testing Fundamentals
portfolio = []
portfolio.[1]('Test login functionality')
Drag options to blanks, or click blank then click option'
Aremove
Bappend
Cpop
Dclear
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove or pop will delete items instead of adding.
2fill in blank
medium

Complete the code to check if 'Test API' is in your portfolio.

Testing Fundamentals
if 'Test API' [1] portfolio:
    print('Test case found')
Drag options to blanks, or click blank then click option'
Ain
Bequals
Cnot in
Dcontains
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'not in' will check the opposite condition.
3fill in blank
hard

Fix the error in the code to print the number of test cases in the portfolio.

Testing Fundamentals
print('Total tests:', [1](portfolio))
Drag options to blanks, or click blank then click option'
Acount
Blength
Clen
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to call len as a method on the list causes an error.
4fill in blank
hard

Fill both blanks to create a dictionary of test names and their status.

Testing Fundamentals
test_status = {test: [1] for test in portfolio if test [2] 'Test login functionality'}
Drag options to blanks, or click blank then click option'
A'passed'
B==
C!=
D'failed'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '!=' will include only the login test.
5fill in blank
hard

Fill all three blanks to filter and map test cases with 'passed' status.

Testing Fundamentals
passed_tests = {test[1]: status for test, status in test_status.items() if status [2] [3]
Drag options to blanks, or click blank then click option'
A.upper()
B==
C'passed'
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' changes the filter logic.