Drag and drop the code snippets from the bottom onto the blanks in the Python script to construct a unit test that checks the API response. Not all options are used.
Thats correct:
Explanation of the Correct Answers:
Blank 1:
resp.status_code
Retrieves the HTTP status code from the API response to ensure the request was successful (200 OK).
Blank 2:
resp.content_type
Checks that the response content type is application/json, confirming that the API returns data in the expected format.
Blank 3:
self.assertTrue
Verifies that exactly one object is present in the API response (ensuring correct retrieval by ID).
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
daniii89
3 months ago