* Add IAM Role Description field to list_roles responses
The IAM ListRoles IAM API call will return the Description key/value
for each role if it exists. If it does not exist the Description
key is not included.
* fix handling in create_role resp
* blackg
* Combine two tests using pytest.mark.parametrize
* consistency
Also I found extra tests for describe_task_definition and deregister_task_definition that were not being run,
so I changed their names so they are found by pytest and made them pass. I also added checks to them for the new
status field.
* Support - added refresh_trusted_advisor_check
- Returns a random check status
- Returns the check id in the response
- Testing for these two functionalities
* test_support - addressed PR comments, to cycle through a faked number of
check status responses
* pool domain should always return a domain
Refs https://github.com/spulec/moto/issues/3706
* set character encoding
* test CloudFrontDomain exists on pool domain
* describe pool domain does not return cloudfront domain
* Support Podman for mocking Lambda
Podman supports all Docker APIs used in moto since version 3.0. Note
that Podman requires pulling the image before creating a container
using a fully-qualified image name (e.g., "docker.io/library/busybox"
instead of "busybox").
Test plan:
$ podman system service -t 0
$ DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock" pytest
Fixes https://github.com/spulec/moto/issues/3276
* Run black
* Python 2 compatibility
* Address review comments and improve parse_image_ref
* Fix: DynamoDB:GetItem throws wrong error when table doesn't exist
* Use unique exception for table not found, per PR feedback
* Just fix the reported issue, without touching anything else...
* events: fix archive event pattern match check
There is a missing `return True` for the positive match case in
matches_pattern, causing all valid patterns to fail.
* events: add test for valid, non-empty pattern match
* support - intial commit to kick off trusted advisor checks
* edit - expanded testing to include checking for expected check ids and
check names.
Added server testing
added support resource json to manifest file and simplified
support response return from reviewed comments
* Streamline loading of resource files
* edit - ensured regions are assigned in models
Co-authored-by: Bert Blommers <info@bertblommers.nl>
AWS requires certain parameters to be mutually inclusive.
Moto wasn't doing anything with the InstanceId parameter, which is now made
clear with a TODO.
* Fix `DBInstanceNotFound` error message
Changed from `Database` to `DBInstance`, which is actually what comes back from AWS.
* Remove duplicate test
The removed test actually fails if run in isolation because `rds2` is not a
valid boto3 client service. The reason this test never caused CI to fail is
because it is redefined later in the test suite, effectively making it dead
code that will never run.
Duplicate test has been removed and the remaining test has been improved
with more explicit asserts.
* fix heartbeatTimeout of NONE resulting in ValueError and polling returning empty string taskToken when it shouldn't be returned
* fix expected taskToken in impacted tests
Co-authored-by: Clint Parham <cparham@aligntech.com>
* correct exceptions when mising parameters
* test_render_template function
* update ses template function
* fix import
* except fixed
* tests and py2 fix
* Add support for RDS resource filtering
* Extensive testing was performed against real AWS endpoints in order to
nail down the filter behavior under various scenarios, ensuring that
`moto` returns the proper response or error.
* Full test coverage of all utility functions as well as several
filter/parameter combinations.
* Split up filter tests, per PR feedback
* Remove unused import
* Fix pytest teardown failure on Python 2.7
* Update the s3 post functionality to better support success_action_redirect
- Add the bucket/key values to the redirect url like s3 does, which
supports code that relies on the key value being there on the
redirect.
- Add support for replacing ${filename} in the key value with the actual
filename from the form upload.
See Issue #3667
* Update s3 tests for changed success_action_redirect behavior
- Adds a new test called test_s3_server_post_to_bucket_redirect that
tests both the ${filename} replacement and the key/value addition to the
redirect query args
- Updated the test_creating_presigned_post checks to handle the
key/value additions to the redirect url.
* Fix test updates to work with python2.7
- remove f-string usage
- fix urllib.parse imports to use six
Co-authored-by: Wynn Wilkes <wynn@leading2lean.com>
* Add KmsKeyId to Redshift Cluster
Add the KmsKeyId property when creating a cluster so that it is also
returned when querying the describe_clusters endpoint.
* Run black on updated files
* Add unit test for Redshift KmsKeyId
* Re-run black with correct version
The response returned for sns.get_endpoint_attributes was not in
sync with the actual response from boto.
Co-authored-by: Antillon, Alejandro <alejandro.antillon@f-secure.com>
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request. These tests do not cover or verify
any `moto` behavior and have been removed.
The `botocore` response parsers are forgiving when it comes to timestamps,
but a real AWS backend does return time zone details for this attribute.
Verified failure/fix using the Go repo included in the issue report.
Fixes#3516
* Address `boto` deprecation warnings
This commit eliminates the following warning:
../boto/ec2/connection.py:582:
PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.
`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.
* Remove `invoke_lambda` tracebacks from unit test logging
If an exception is encountered, the details are returned in the response payload.
Printing the traceback was just adding noise to the pytest output.
* Use known AMIs in unit tests
This commit eliminates the following warning in the pytest output:
`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`
Known, pre-loaded AMI image ids are used instead of random ids that don't actually
exist in the moto backend. The integrity of the tests is unaffected by this change.
A test has been added to provide explicit coverage of the PendingDeprecationWarning
raised when an invalid AMI image id is passed to moto.
The latest release of `botocore` (1.19.62) makes changes to the parameter
validation code, which for some reason was also covered by a couple of
`moto` tests.
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request. These tests do not cover or verify
any `moto` behavior and have been removed.
Ref: ff8ae76eccCloses#3627
Moto's implementation of autoscaling:CreateLaunchConfiguration is a little too loose,
allowing the ImageId parameter to be omitted and defaulting it to None, which results
in dozens of deprecation warnings:
`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`
This commit refactors calls to CreateLaunchConfiguration to explicitly pass in a known
AMI ImageId in order to avoid these warnings.
The integrity of the tests is unaffected by this change.
This commit eliminates the following warning (of which there are currently dozens):
../boto/ec2/connection.py:582:
PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.
`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.