200-901 Application Deployment and Security Practice Question
A developer is writing a unit test for a Python function that calls the Cisco Meraki Dashboard API to retrieve a list of organizations. The test must run without making real HTTP requests to the Meraki cloud. Which technique should be used to isolate the function under test?
⚠ Common exam trap
It's easy for candidates to confuse a longer timeout or a real API key with true isolation, when the goal is to eliminate the network call rather than wait longer for it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the unittest.mock library to patch the requests.get call and return a canned JSON response.
Unit tests for API clients should isolate the code under test from external services. Patching the HTTP call with unittest.mock lets the test supply a fixed JSON payload and verify how the function handles it, including success and error paths. This keeps the test fast, repeatable, and independent of the Meraki Dashboard API's availability or rate limits.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run the test only on a developer workstation that has a valid Meraki API key configured.
Why it's wrong here
Restricting the test to a workstation with a real API key still relies on live Meraki API calls and valid credentials, which violates the requirement to avoid real HTTP requests. It also prevents the test from running reliably in CI where secrets may not be present. The function under test would still depend on external state.
- ✓
Use the unittest.mock library to patch the requests.get call and return a canned JSON response.
Why this is correct
Patching requests.get with unittest.mock replaces the real network call with a controlled return value, so the test exercises the function's parsing and error handling without contacting the Meraki Dashboard API. This makes the test fast, deterministic, and safe to run in CI. It is the standard Python approach for isolating external HTTP dependencies in unit tests.
- ✗
Replace the API call with a print statement that outputs the expected organization list.
Why it's wrong here
Replacing the call with a print statement removes the code path under test entirely, so the test no longer verifies the function's behavior. It does not simulate a response that the function can parse, and it provides no assertion value. This is not a valid isolation technique because it changes the function instead of mocking the dependency.
- ✗
Increase the test timeout to 60 seconds so the real Meraki API call has time to complete.
Why it's wrong here
Increasing the timeout still performs a real network request to the Meraki cloud, which makes the test dependent on internet connectivity, API rate limits, and live organization data. The requirement is to run without real HTTP requests, so extending the timeout does not address the isolation goal. It also makes tests slower and flakier.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.