Prep release 5.0.4 (#7525)
This commit is contained in:
parent
1fc22000d9
commit
90adead245
70
CHANGELOG.md
70
CHANGELOG.md
@ -1,6 +1,76 @@
|
|||||||
Moto Changelog
|
Moto Changelog
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
5.0.4
|
||||||
|
-----
|
||||||
|
Docker Digest for 5.0.4: <autopopulateddigest>
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Lambda: The results of a Dockerless invocation can now be configured.
|
||||||
|
See http://docs.getmoto.org/en/latest/docs/services/lambda.html
|
||||||
|
|
||||||
|
* StepFunctions can now execute the provided StepFunctionMachine (opt-in), instead of returning static data (still the default).
|
||||||
|
See http://docs.getmoto.org/en/latest/docs/services/stepfunctions.html
|
||||||
|
|
||||||
|
New Service:
|
||||||
|
* ElastiCache:
|
||||||
|
* list_tags_for_resource()
|
||||||
|
|
||||||
|
* ResilienceHub:
|
||||||
|
* create_app()
|
||||||
|
* create_app_version_app_component()
|
||||||
|
* create_app_version_resource()
|
||||||
|
* create_resiliency_policy()
|
||||||
|
* describe_app()
|
||||||
|
* describe_resiliency_policy()
|
||||||
|
* import_resources_to_draft_app_version()
|
||||||
|
* list_app_assessments()
|
||||||
|
* list_app_version_app_components()
|
||||||
|
* list_app_version_resources()
|
||||||
|
* list_app_versions()
|
||||||
|
* list_apps()
|
||||||
|
* list_resiliency_policies()
|
||||||
|
* list_tags_for_resource()
|
||||||
|
* publish_app_version()
|
||||||
|
* tag_resource()
|
||||||
|
* untag_resource()
|
||||||
|
|
||||||
|
* Workspaces:
|
||||||
|
* create_tags()
|
||||||
|
* create_workspace_image()
|
||||||
|
* create_workspaces()
|
||||||
|
* deregister_workspace_directory()
|
||||||
|
* describe_client_properties()
|
||||||
|
* describe_tags()
|
||||||
|
* describe_workspace_directories()
|
||||||
|
* describe_workspace_image_permissions()
|
||||||
|
* describe_workspace_images()
|
||||||
|
* describe_workspaces()
|
||||||
|
* modify_client_properties()
|
||||||
|
* modify_selfservice_permissions()
|
||||||
|
* modify_workspace_creation_properties()
|
||||||
|
* register_workspace_directory()
|
||||||
|
* update_workspace_image_permission()
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* APIGateway: update_usage_plan() now supports some remove-operations
|
||||||
|
* Autoscaling: describe_auto_scaling_groups() now returns a dynamic CreatedTime
|
||||||
|
* CloudFormation: Outputs now support Conditions
|
||||||
|
* CloudFormation: Outputs now return Descriptions
|
||||||
|
* CognitoIDP: admin_update_user_attributes() and admin_delete_user_attributes now correctly update the UserLastModifiedDate
|
||||||
|
* DynamoDB: query() no longer requires the LastEvaluatedKey to exist
|
||||||
|
* EC2: describe_vpc_endpoint_services() now supports all services
|
||||||
|
* Kinesis: list_streams() now returns StreamSummaries
|
||||||
|
* Lambda: get_policy() now throws an error when no statements exist
|
||||||
|
* ResourceGroupsTaggingAPI now supports DynamoDB tables
|
||||||
|
* ResourceGroupsTaggingAPI now supports SSM documents
|
||||||
|
* S3: EventBridge notifications are now supported for ObjectRestore:Post
|
||||||
|
* S3: restore_object() now contains limited validation when supplying both Days- and Type-argument
|
||||||
|
* S3: select_object_content() now supports Compressed requests and CSV responses
|
||||||
|
* SecretsManager: list_secrets() now handles negative matches correctly
|
||||||
|
* SNS: delete_endpoint() is now an idempotent operation, just like AWS
|
||||||
|
|
||||||
|
|
||||||
5.0.3
|
5.0.3
|
||||||
-----
|
-----
|
||||||
Docker Digest for 5.0.3: _sha256:032d8ead42f289d9700e9bc844c6d264575ad11b3f6c22cc76d65ff638c8c7bd_
|
Docker Digest for 5.0.3: _sha256:032d8ead42f289d9700e9bc844c6d264575ad11b3f6c22cc76d65ff638c8c7bd_
|
||||||
|
@ -2870,7 +2870,7 @@
|
|||||||
|
|
||||||
## elasticache
|
## elasticache
|
||||||
<details>
|
<details>
|
||||||
<summary>8% implemented</summary>
|
<summary>9% implemented</summary>
|
||||||
|
|
||||||
- [ ] add_tags_to_resource
|
- [ ] add_tags_to_resource
|
||||||
- [ ] authorize_cache_security_group_ingress
|
- [ ] authorize_cache_security_group_ingress
|
||||||
@ -2928,7 +2928,7 @@
|
|||||||
- [ ] increase_node_groups_in_global_replication_group
|
- [ ] increase_node_groups_in_global_replication_group
|
||||||
- [ ] increase_replica_count
|
- [ ] increase_replica_count
|
||||||
- [ ] list_allowed_node_type_modifications
|
- [ ] list_allowed_node_type_modifications
|
||||||
- [ ] list_tags_for_resource
|
- [X] list_tags_for_resource
|
||||||
- [ ] modify_cache_cluster
|
- [ ] modify_cache_cluster
|
||||||
- [ ] modify_cache_parameter_group
|
- [ ] modify_cache_parameter_group
|
||||||
- [ ] modify_cache_subnet_group
|
- [ ] modify_cache_subnet_group
|
||||||
@ -8015,6 +8015,85 @@
|
|||||||
- [X] update_web_acl
|
- [X] update_web_acl
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
## workspaces
|
||||||
|
<details>
|
||||||
|
<summary>20% implemented</summary>
|
||||||
|
|
||||||
|
- [ ] associate_connection_alias
|
||||||
|
- [ ] associate_ip_groups
|
||||||
|
- [ ] associate_workspace_application
|
||||||
|
- [ ] authorize_ip_rules
|
||||||
|
- [ ] copy_workspace_image
|
||||||
|
- [ ] create_connect_client_add_in
|
||||||
|
- [ ] create_connection_alias
|
||||||
|
- [ ] create_ip_group
|
||||||
|
- [ ] create_standby_workspaces
|
||||||
|
- [X] create_tags
|
||||||
|
- [ ] create_updated_workspace_image
|
||||||
|
- [ ] create_workspace_bundle
|
||||||
|
- [X] create_workspace_image
|
||||||
|
- [X] create_workspaces
|
||||||
|
- [ ] delete_client_branding
|
||||||
|
- [ ] delete_connect_client_add_in
|
||||||
|
- [ ] delete_connection_alias
|
||||||
|
- [ ] delete_ip_group
|
||||||
|
- [ ] delete_tags
|
||||||
|
- [ ] delete_workspace_bundle
|
||||||
|
- [ ] delete_workspace_image
|
||||||
|
- [ ] deploy_workspace_applications
|
||||||
|
- [X] deregister_workspace_directory
|
||||||
|
- [ ] describe_account
|
||||||
|
- [ ] describe_account_modifications
|
||||||
|
- [ ] describe_application_associations
|
||||||
|
- [ ] describe_applications
|
||||||
|
- [ ] describe_bundle_associations
|
||||||
|
- [ ] describe_client_branding
|
||||||
|
- [X] describe_client_properties
|
||||||
|
- [ ] describe_connect_client_add_ins
|
||||||
|
- [ ] describe_connection_alias_permissions
|
||||||
|
- [ ] describe_connection_aliases
|
||||||
|
- [ ] describe_image_associations
|
||||||
|
- [ ] describe_ip_groups
|
||||||
|
- [X] describe_tags
|
||||||
|
- [ ] describe_workspace_associations
|
||||||
|
- [ ] describe_workspace_bundles
|
||||||
|
- [X] describe_workspace_directories
|
||||||
|
- [X] describe_workspace_image_permissions
|
||||||
|
- [X] describe_workspace_images
|
||||||
|
- [ ] describe_workspace_snapshots
|
||||||
|
- [X] describe_workspaces
|
||||||
|
- [ ] describe_workspaces_connection_status
|
||||||
|
- [ ] disassociate_connection_alias
|
||||||
|
- [ ] disassociate_ip_groups
|
||||||
|
- [ ] disassociate_workspace_application
|
||||||
|
- [ ] import_client_branding
|
||||||
|
- [ ] import_workspace_image
|
||||||
|
- [ ] list_available_management_cidr_ranges
|
||||||
|
- [ ] migrate_workspace
|
||||||
|
- [ ] modify_account
|
||||||
|
- [ ] modify_certificate_based_auth_properties
|
||||||
|
- [X] modify_client_properties
|
||||||
|
- [ ] modify_saml_properties
|
||||||
|
- [X] modify_selfservice_permissions
|
||||||
|
- [ ] modify_workspace_access_properties
|
||||||
|
- [X] modify_workspace_creation_properties
|
||||||
|
- [ ] modify_workspace_properties
|
||||||
|
- [ ] modify_workspace_state
|
||||||
|
- [ ] reboot_workspaces
|
||||||
|
- [ ] rebuild_workspaces
|
||||||
|
- [X] register_workspace_directory
|
||||||
|
- [ ] restore_workspace
|
||||||
|
- [ ] revoke_ip_rules
|
||||||
|
- [ ] start_workspaces
|
||||||
|
- [ ] stop_workspaces
|
||||||
|
- [ ] terminate_workspaces
|
||||||
|
- [ ] update_connect_client_add_in
|
||||||
|
- [ ] update_connection_alias_permission
|
||||||
|
- [ ] update_rules_of_ip_group
|
||||||
|
- [ ] update_workspace_bundle
|
||||||
|
- [X] update_workspace_image_permission
|
||||||
|
</details>
|
||||||
|
|
||||||
## Unimplemented:
|
## Unimplemented:
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@ -8269,7 +8348,6 @@
|
|||||||
- worklink
|
- worklink
|
||||||
- workmail
|
- workmail
|
||||||
- workmailmessageflow
|
- workmailmessageflow
|
||||||
- workspaces
|
|
||||||
- workspaces-thin-client
|
- workspaces-thin-client
|
||||||
- workspaces-web
|
- workspaces-web
|
||||||
- xray
|
- xray
|
||||||
|
@ -65,7 +65,8 @@ The following options can also be configured when running the MotoServer:
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
"batch": {"use_docker": True},
|
"batch": {"use_docker": True},
|
||||||
"lambda": {"use_docker": True}
|
"lambda": {"use_docker": True},
|
||||||
|
"stepfunctions": {"execute_state_machine": True}
|
||||||
}
|
}
|
||||||
requests.post(f"http://localhost:5000/moto-api/config", json=options)
|
requests.post(f"http://localhost:5000/moto-api/config", json=options)
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ apigateway
|
|||||||
The following PatchOperations are currently supported:
|
The following PatchOperations are currently supported:
|
||||||
add : Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
add : Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
||||||
replace: Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
replace: Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
||||||
remove : Nothing yet
|
remove : Everything except /apiStages/{apidId:stageName}/throttle/ and children
|
||||||
copy : Nothing yet
|
copy : Nothing yet
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ athena
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/athena/query-results",
|
"http://motoapi.amazonaws.com/moto-api/static/athena/query-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -74,7 +74,7 @@ ce
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/ce/cost-and-usage-results",
|
"http://motoapi.amazonaws.com/moto-api/static/ce/cost-and-usage-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -77,7 +77,7 @@ elasticache
|
|||||||
- [ ] increase_node_groups_in_global_replication_group
|
- [ ] increase_node_groups_in_global_replication_group
|
||||||
- [ ] increase_replica_count
|
- [ ] increase_replica_count
|
||||||
- [ ] list_allowed_node_type_modifications
|
- [ ] list_allowed_node_type_modifications
|
||||||
- [ ] list_tags_for_resource
|
- [X] list_tags_for_resource
|
||||||
- [ ] modify_cache_cluster
|
- [ ] modify_cache_cluster
|
||||||
- [ ] modify_cache_parameter_group
|
- [ ] modify_cache_parameter_group
|
||||||
- [ ] modify_cache_subnet_group
|
- [ ] modify_cache_subnet_group
|
||||||
|
@ -82,7 +82,7 @@ inspector2
|
|||||||
"region": "us-east-1", # This is the default - can be omitted
|
"region": "us-east-1", # This is the default - can be omitted
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/inspector2/findings-results",
|
"http://motoapi.amazonaws.com/moto-api/static/inspector2/findings-results",
|
||||||
json=findings,
|
json=findings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -81,15 +81,15 @@ lambda
|
|||||||
|
|
||||||
expected_results = {"results": ["test", "test 2"], "region": "us-east-1"}
|
expected_results = {"results": ["test", "test 2"], "region": "us-east-1"}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/lambda-simple/response",
|
"http://motoapi.amazonaws.com/moto-api/static/lambda-simple/response",
|
||||||
json=expected_results,
|
json=expected_results
|
||||||
)
|
)
|
||||||
|
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
|
||||||
client = boto3.client("lambda", region_name="us-east-1")
|
client = boto3.client("lambda", region_name="us-east-1")
|
||||||
resp = client.invoke(...) # resp["Payload"].read().decode() == "test"
|
resp = client.invoke(...) # resp["Payload"].read().decode() == "test"
|
||||||
resp = client.invoke(...) # resp["Payload"].read().decode() == "test2"
|
resp = client.invoke(...) # resp["Payload"].read().decode() == "test2"
|
||||||
|
|
||||||
|
|
||||||
- [ ] invoke_async
|
- [ ] invoke_async
|
||||||
- [ ] invoke_with_response_stream
|
- [ ] invoke_with_response_stream
|
||||||
|
@ -47,7 +47,7 @@ rds-data
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/rds-data/statement-results",
|
"http://motoapi.amazonaws.com/moto-api/static/rds-data/statement-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -22,7 +22,7 @@ resourcegroupstaggingapi
|
|||||||
- [ ] start_report_creation
|
- [ ] start_report_creation
|
||||||
- [X] tag_resources
|
- [X] tag_resources
|
||||||
|
|
||||||
Only Logs and RDS resources are currently supported
|
Only DynamoDB, Logs and RDS resources are currently supported
|
||||||
|
|
||||||
|
|
||||||
- [ ] untag_resources
|
- [ ] untag_resources
|
||||||
|
@ -114,6 +114,7 @@ s3
|
|||||||
- 's3:ObjectCreated:Post'
|
- 's3:ObjectCreated:Post'
|
||||||
- 's3:ObjectCreated:Put'
|
- 's3:ObjectCreated:Put'
|
||||||
- 's3:ObjectDeleted'
|
- 's3:ObjectDeleted'
|
||||||
|
- 's3:ObjectRestore:Post'
|
||||||
|
|
||||||
|
|
||||||
- [X] put_bucket_ownership_controls
|
- [X] put_bucket_ownership_controls
|
||||||
|
@ -42,7 +42,7 @@ sagemaker-runtime
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
requests.post(
|
requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/sagemaker/endpoint-results",
|
"http://motoapi.amazonaws.com/moto-api/static/sagemaker/endpoint-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
96
docs/docs/services/workspaces.rst
Normal file
96
docs/docs/services/workspaces.rst
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
.. _implementedservice_workspaces:
|
||||||
|
|
||||||
|
.. |start-h3| raw:: html
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
|
||||||
|
.. |end-h3| raw:: html
|
||||||
|
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
==========
|
||||||
|
workspaces
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. autoclass:: moto.workspaces.models.WorkSpacesBackend
|
||||||
|
|
||||||
|
|start-h3| Implemented features for this service |end-h3|
|
||||||
|
|
||||||
|
- [ ] associate_connection_alias
|
||||||
|
- [ ] associate_ip_groups
|
||||||
|
- [ ] associate_workspace_application
|
||||||
|
- [ ] authorize_ip_rules
|
||||||
|
- [ ] copy_workspace_image
|
||||||
|
- [ ] create_connect_client_add_in
|
||||||
|
- [ ] create_connection_alias
|
||||||
|
- [ ] create_ip_group
|
||||||
|
- [ ] create_standby_workspaces
|
||||||
|
- [X] create_tags
|
||||||
|
- [ ] create_updated_workspace_image
|
||||||
|
- [ ] create_workspace_bundle
|
||||||
|
- [X] create_workspace_image
|
||||||
|
- [X] create_workspaces
|
||||||
|
- [ ] delete_client_branding
|
||||||
|
- [ ] delete_connect_client_add_in
|
||||||
|
- [ ] delete_connection_alias
|
||||||
|
- [ ] delete_ip_group
|
||||||
|
- [ ] delete_tags
|
||||||
|
- [ ] delete_workspace_bundle
|
||||||
|
- [ ] delete_workspace_image
|
||||||
|
- [ ] deploy_workspace_applications
|
||||||
|
- [X] deregister_workspace_directory
|
||||||
|
Deregister Workspace Directory with the matching ID.
|
||||||
|
|
||||||
|
- [ ] describe_account
|
||||||
|
- [ ] describe_account_modifications
|
||||||
|
- [ ] describe_application_associations
|
||||||
|
- [ ] describe_applications
|
||||||
|
- [ ] describe_bundle_associations
|
||||||
|
- [ ] describe_client_branding
|
||||||
|
- [X] describe_client_properties
|
||||||
|
- [ ] describe_connect_client_add_ins
|
||||||
|
- [ ] describe_connection_alias_permissions
|
||||||
|
- [ ] describe_connection_aliases
|
||||||
|
- [ ] describe_image_associations
|
||||||
|
- [ ] describe_ip_groups
|
||||||
|
- [X] describe_tags
|
||||||
|
- [ ] describe_workspace_associations
|
||||||
|
- [ ] describe_workspace_bundles
|
||||||
|
- [X] describe_workspace_directories
|
||||||
|
Return info on all directories or directories with matching IDs.
|
||||||
|
|
||||||
|
- [X] describe_workspace_image_permissions
|
||||||
|
- [X] describe_workspace_images
|
||||||
|
- [ ] describe_workspace_snapshots
|
||||||
|
- [X] describe_workspaces
|
||||||
|
- [ ] describe_workspaces_connection_status
|
||||||
|
- [ ] disassociate_connection_alias
|
||||||
|
- [ ] disassociate_ip_groups
|
||||||
|
- [ ] disassociate_workspace_application
|
||||||
|
- [ ] import_client_branding
|
||||||
|
- [ ] import_workspace_image
|
||||||
|
- [ ] list_available_management_cidr_ranges
|
||||||
|
- [ ] migrate_workspace
|
||||||
|
- [ ] modify_account
|
||||||
|
- [ ] modify_certificate_based_auth_properties
|
||||||
|
- [X] modify_client_properties
|
||||||
|
- [ ] modify_saml_properties
|
||||||
|
- [X] modify_selfservice_permissions
|
||||||
|
- [ ] modify_workspace_access_properties
|
||||||
|
- [X] modify_workspace_creation_properties
|
||||||
|
- [ ] modify_workspace_properties
|
||||||
|
- [ ] modify_workspace_state
|
||||||
|
- [ ] reboot_workspaces
|
||||||
|
- [ ] rebuild_workspaces
|
||||||
|
- [X] register_workspace_directory
|
||||||
|
- [ ] restore_workspace
|
||||||
|
- [ ] revoke_ip_rules
|
||||||
|
- [ ] start_workspaces
|
||||||
|
- [ ] stop_workspaces
|
||||||
|
- [ ] terminate_workspaces
|
||||||
|
- [ ] update_connect_client_add_in
|
||||||
|
- [ ] update_connection_alias_permission
|
||||||
|
- [ ] update_rules_of_ip_group
|
||||||
|
- [ ] update_workspace_bundle
|
||||||
|
- [X] update_workspace_image_permission
|
||||||
|
|
@ -259,7 +259,7 @@ class AthenaBackend(BaseBackend):
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/athena/query-results",
|
"http://motoapi.amazonaws.com/moto-api/static/athena/query-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -2375,6 +2375,26 @@ class LambdaBackend(BaseBackend):
|
|||||||
) -> Optional[Union[str, bytes]]:
|
) -> Optional[Union[str, bytes]]:
|
||||||
"""
|
"""
|
||||||
Invoking a Function with PackageType=Image is not yet supported.
|
Invoking a Function with PackageType=Image is not yet supported.
|
||||||
|
|
||||||
|
Invoking a Funcation against Lambda without docker now supports customised responses, the default being `Simple Lambda happy path OK`.
|
||||||
|
You can use a dedicated API to override this, by configuring a queue of expected results.
|
||||||
|
|
||||||
|
A request to `invoke` will take the first result from that queue.
|
||||||
|
|
||||||
|
Configure this queue by making an HTTP request to `/moto-api/static/lambda-simple/response`. An example invocation looks like this:
|
||||||
|
|
||||||
|
.. sourcecode:: python
|
||||||
|
|
||||||
|
expected_results = {"results": ["test", "test 2"], "region": "us-east-1"}
|
||||||
|
resp = requests.post(
|
||||||
|
"http://motoapi.amazonaws.com/moto-api/static/lambda-simple/response",
|
||||||
|
json=expected_results
|
||||||
|
)
|
||||||
|
assert resp.status_code == 201
|
||||||
|
|
||||||
|
client = boto3.client("lambda", region_name="us-east-1")
|
||||||
|
resp = client.invoke(...) # resp["Payload"].read().decode() == "test"
|
||||||
|
resp = client.invoke(...) # resp["Payload"].read().decode() == "test2"
|
||||||
"""
|
"""
|
||||||
fn = self.get_function(function_name, qualifier)
|
fn = self.get_function(function_name, qualifier)
|
||||||
payload = fn.invoke(body, headers, response_headers)
|
payload = fn.invoke(body, headers, response_headers)
|
||||||
|
@ -23,7 +23,7 @@ class LambdaSimpleBackend(LambdaBackend):
|
|||||||
headers: Any,
|
headers: Any,
|
||||||
response_headers: Any,
|
response_headers: Any,
|
||||||
) -> Optional[Union[str, bytes]]:
|
) -> Optional[Union[str, bytes]]:
|
||||||
default_result = "Simple Lambda happy path OK"
|
default_result = body or "Simple Lambda happy path OK"
|
||||||
if self.lambda_simple_results_queue:
|
if self.lambda_simple_results_queue:
|
||||||
default_result = self.lambda_simple_results_queue.pop(0)
|
default_result = self.lambda_simple_results_queue.pop(0)
|
||||||
return str.encode(default_result)
|
return str.encode(default_result)
|
||||||
|
@ -191,7 +191,7 @@ class CostExplorerBackend(BaseBackend):
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/ce/cost-and-usage-results",
|
"http://motoapi.amazonaws.com/moto-api/static/ce/cost-and-usage-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -196,7 +196,7 @@ class Inspector2Backend(BaseBackend):
|
|||||||
"region": "us-east-1", # This is the default - can be omitted
|
"region": "us-east-1", # This is the default - can be omitted
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/inspector2/findings-results",
|
"http://motoapi.amazonaws.com/moto-api/static/inspector2/findings-results",
|
||||||
json=findings,
|
json=findings,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class RDSDataServiceBackend(BaseBackend):
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
resp = requests.post(
|
resp = requests.post(
|
||||||
"http://motoapi.amazonaws.com:5000/moto-api/static/rds-data/statement-results",
|
"http://motoapi.amazonaws.com/moto-api/static/rds-data/statement-results",
|
||||||
json=expected_results,
|
json=expected_results,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
|
@ -2379,6 +2379,7 @@ class S3Backend(BaseBackend, CloudWatchMetricProvider):
|
|||||||
- 's3:ObjectCreated:Post'
|
- 's3:ObjectCreated:Post'
|
||||||
- 's3:ObjectCreated:Put'
|
- 's3:ObjectCreated:Put'
|
||||||
- 's3:ObjectDeleted'
|
- 's3:ObjectDeleted'
|
||||||
|
- 's3:ObjectRestore:Post'
|
||||||
"""
|
"""
|
||||||
bucket = self.get_bucket(bucket_name)
|
bucket = self.get_bucket(bucket_name)
|
||||||
bucket.set_notification_configuration(notification_config)
|
bucket.set_notification_configuration(notification_config)
|
||||||
|
@ -41,6 +41,13 @@ def test_run_function_no_log():
|
|||||||
# Execute
|
# Execute
|
||||||
result = client.invoke(FunctionName=FUNCTION_NAME, Payload=json.dumps(payload))
|
result = client.invoke(FunctionName=FUNCTION_NAME, Payload=json.dumps(payload))
|
||||||
|
|
||||||
|
# Verify
|
||||||
|
assert result["StatusCode"] == 200
|
||||||
|
assert json.loads(result["Payload"].read().decode("utf-8")) == payload
|
||||||
|
|
||||||
|
# Execute
|
||||||
|
result = client.invoke(FunctionName=FUNCTION_NAME)
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
assert result["StatusCode"] == 200
|
assert result["StatusCode"] == 200
|
||||||
assert result["Payload"].read().decode("utf-8") == "Simple Lambda happy path OK"
|
assert result["Payload"].read().decode("utf-8") == "Simple Lambda happy path OK"
|
||||||
|
Loading…
Reference in New Issue
Block a user