DEVASC Exam QuestionsBrowse all questions from this exam

DEVASC Exam - Question 557


DRAG DROP

-

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.

Show Answer
Correct Answer:

Discussion

1 comment
Sign in to comment
daniii89
Feb 7, 2025

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).