What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Passing unit tests does not prove a deployed API works: a test that calls a Lambda handler directly skips API Gateway routing and the real HTTP request path. A stronger check adds HTTP integration tests locally with AWS SAM and, after deployment, against the API Gateway URL. Each layer catches different failures, so keep unit, local, and deployed tests focused on the behavior they can actually verify.

What each test layer checks

The example described by Gloria, writing for AWS Community Builders, uses Python 3.11, AWS SAM, API Gateway, Lambda, and pytest. The three test layers exercise progressively broader request paths; they are complementary, not interchangeable.

Test layer Request path Prerequisites Useful for finding
Unit Calls the Lambda handler directly. Application and test dependencies; it does not require the local HTTP service or a deployed AWS stack. Application logic and edge cases within the handler.
Local integration Sends HTTP requests through the example’s SAM local API simulation. AWS SAM and Docker; the article says no AWS account is needed. Behavior involving the local HTTP path and its routing or wiring.
Deployed integration Sends real network requests to API Gateway, which invokes Lambda in the deployed stack. A deployed stack and AWS credentials to look up its output URL. Deployment configuration, API Gateway-to-Lambda wiring, and real HTTP behavior.

Gloria characterizes local checks as free and deployed checks as pay-per-request, but these are descriptions of the example rather than universal cost or timing guarantees. The tutorial’s reported timings are likewise specific to the author’s run: 0.16 seconds for 15 unit tests, 11.53 seconds for 6 local integration tests, and 21.25 seconds for 7 deployed integration tests. The retrieved article page says “Posted on Sep 17” but does not state a year, and the results were not independently reproduced.

Run local HTTP checks with SAM

Unit tests do not start an HTTP server or verify that a request reaches the right route. The example uses sam local start-api to expose the API through SAM’s local simulation, then sends HTTP requests to it. Docker is required for this local workflow. The walkthrough says this local path does not require an AWS account; confirm the behavior against your installed SAM version and API configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Before relying on the local suite, make sure the local API is running and tests target its URL. Check both responses and routing: a handler-level test cannot reveal a mismatch between an HTTP route and the Lambda event the handler receives.

Test the deployed endpoint through API Gateway

For the deployed suite, the example reads the AWS_SAM_STACK_NAME environment variable, calls CloudFormation’s describe_stacks, maps stack output keys to endpoint URLs, and passes those URLs into pytest tests. Its sample dependencies include boto3 for the AWS lookup and requests for HTTP requests. The stack must already be deployed, and the test process needs AWS credentials that can retrieve its outputs.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  1. Confirm the deployment responds: use a browser or curl against the API Gateway URL from the stack outputs. This manual check helps distinguish an unavailable deployment from a failing test assertion.
  2. Set the stack name: configure AWS_SAM_STACK_NAME for the deployed stack the test fixture should inspect.
  3. Run the deployed pytest suite: let the fixture retrieve endpoint URLs from CloudFormation and send HTTP requests to the relevant routes.

The exact command for running pytest depends on the project’s test layout; the source describes the fixture and dependencies rather than prescribing a universal command. Treat successful results as evidence for the cases exercised, not proof that untested routes or inputs work.

Assert the HTTP contract, not just a successful response

The example’s deployed tests cover the default greeting, a supplied name parameter, response headers, HTML from /get-documentation, HTML from /, an unknown route, and a rejected POST request. For your own API, assert the parts of the HTTP contract that matter to clients:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  • Status code and response body for successful requests.
  • Content type and CORS headers where the API promises them.
  • Expected behavior for known routes, unknown routes, and unsupported methods.
  • Boundary inputs such as omitted and empty query parameters.

Do not assume every layer returns the same error for an unknown route. In Gloria’s example, the local unknown route returns 404, while the deployed API Gateway path returns 403 with “Missing Authentication Token” before Lambda executes. That difference reflects where the request is rejected in that example; it is not a universal API Gateway contract. Set expectations from your API’s actual configuration and decide whether the test is asserting Lambda behavior or the deployed gateway’s response.

Catch the empty-query-parameter bug

A passing happy-path suite can still miss a meaningful input distinction. After reporting seven deployed tests passing, Gloria tried /hello?name= and observed Hello, !. The sample lookup, query_params.get("name", "World"), uses "World" only when the key is absent. If the key is present with an empty string, that empty string is returned instead.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

If the intended behavior is to use “World” for both a missing and an empty name, the article suggests changing the lookup to:

query_params.get("name") or "World"

Add regression coverage for the empty value at each relevant layer: handler unit test, local HTTP integration test, and deployed HTTP integration test. Gloria’s article proposes expanded counts of 16 unit, 7 local integration, and 8 deployed integration tests (31 total) after adding that case. Those counts are a proposed suite size, not a verified run.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the right layer for a failure

  • If the handler returns the wrong greeting for an input when called directly, investigate application logic and its unit tests.
  • If handler tests pass but the local HTTP route fails, inspect the SAM local setup, route configuration, and event wiring.
  • If local HTTP checks pass but the deployed request fails, inspect deployed stack outputs, API Gateway configuration, credentials, and the actual HTTP response.
  • If an error response differs between local and deployed environments, identify which layer generated it before changing the assertion or application.

Gloria summarizes the distinction this way: “Unit tests prove your logic. Integration tests prove your wiring. Both are necessary. Neither replaces the other.”

Source: Gloria, AWS Community Builders, DEV Community article (page displays “Posted on Sep 17”; year not stated in the retrieved page text).

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.