0
0
Testing Fundamentalstesting~10 mins

CRUD operation verification 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 check if a new record was successfully created.

Testing Fundamentals
assert response.status_code == [1]
Drag options to blanks, or click blank then click option'
A201
B404
C400
D200
Attempts:
3 left
💡 Hint
Common Mistakes
Using 200 instead of 201 for creation success.
Confusing 404 (Not Found) with success codes.
2fill in blank
medium

Complete the code to verify that the update operation changed the record's name.

Testing Fundamentals
assert updated_record.[1] == 'New Name'
Drag options to blanks, or click blank then click option'
Aname
Bdate
Cstatus
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Checking the wrong attribute like 'id' or 'status'.
Not verifying the updated value.
3fill in blank
hard

Fix the error in the code that verifies deletion by checking the record count.

Testing Fundamentals
assert len(records) [1] initial_count - 1
Drag options to blanks, or click blank then click option'
A<
B>
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using < or > instead of ==.
Using != which allows wrong counts.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps user IDs to emails for active users only.

Testing Fundamentals
{user.[1]: user.[2] for user in users if user.active}
Drag options to blanks, or click blank then click option'
Aid
Bemail
Cname
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' or 'status' instead of 'email' for values.
Mixing keys and values.
5fill in blank
hard

Fill all three blanks to filter records with score above 50 and create a dictionary of names to scores.

Testing Fundamentals
result = {record.[1]: record.[2] for record in records if record.[3] > 50}
Drag options to blanks, or click blank then click option'
Aname
Bscore
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'id' instead of 'name' as keys.
Filtering on the wrong attribute.