* Make security rules consistent between direct (backend) and indirect (api) boundaries
Security rules added directly via the backend were unable to be revoked via the API
because the port values were being stored as strings but were always coerced back
to integers by the botocore model. `"0" != 0`, so the rules would never match,
raising an `InvalidPermissionNotFoundError`.
This change ensures that the port values for a security group rule are always of type
`Union[int, None]`.
No tests needed to be modified as a result of this change. A new test was added that
explicitly covers the behavior that had been failing.
* Skip test in server mode
* Modify put_parameter() to raise ValidationError when value is empty string
* Simplify empty string check
Co-authored-by: Tom Noble <tom.noble@bjss.com>
The `InvalidPermission.Duplicate` error was already implemented for inbound rules,
but AWS also returns this error for duplicate outbound rules.
Very minor changes were needed on existing tests that were adding duplicate
outbound rules (when testing the RulesPerSecurityGroupLimitExceeded error).
* between clause is not case-sensitive anymore
* begins_with will raise an exception unless lower-case is used
Co-authored-by: David Pedrosa <d.pedrosa@indizen.com>
* adding physical_resource_id in SubnetRouteTableAssociation, Route and NatGW classes
* adding tests
* passing litern at test
* passsing black==19.10b0 as lintern
* passing test to python 2.7
* feature/support create_case, resolve_case, describe_cases and associated
tests
* review/support - addressed PR comments
- Have created a SupportCase object to persist case
- Associated testing to address PR comments
* Support - simplify tests
* Support - Simplify tests even more
Co-authored-by: Bert Blommers <info@bertblommers.nl>
* fix route table association by internet gateway per https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateRouteTable.html
* Route53
- Add test for route table association by internet gateway
- Minor test tweak for Main route table values
TODO: explicitly set the route table main route association
* Route53
- forgot subnet id association test
Co-authored-by: Tony Greising-Murschel <tony@platform.sh>
The Record class was already capturing a unix timestamp, but it was incorrectly
converting it to ISO format when sending back to the client.
Updating the model to return the correct timestamp necessitated a minor change
to one of the tests because `botocore` converts non-timezone aware timestamps
to local time.
* 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>