def METHOD_NAME(ec2_client, subnet_id, expected_internet_gateway_id):
    """
    Check that the given internet_gateway is associated with the route of the subnet.
    :param ec2_client: the boto3 client to which make requests
    :param subnet_id: the subnet associated with the route we want to verify
    :param expected_internet_gateway_id: the gateway we expect to find in the route
    """
    response = ec2_client.describe_route_tables(Filters=[{"Name": "association.subnet-id", "Values": [subnet_id]}])
    routes = response["RouteTables"][0]["Routes"]
    internet_gateway_route = next(route for route in routes if route["DestinationCidrBlock"] == "0.0.0.0/0")
    assert_that(internet_gateway_route).contains("GatewayId")
    assert_that(internet_gateway_route["GatewayId"]).is_equal_to(expected_internet_gateway_id)