moto/tests
Brian Pandola 463472c2b2
Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817)
* 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
2021-03-31 19:33:36 +01:00
..
test_acm Linting 2020-11-11 15:55:37 +00:00
test_apigateway added feature update_usage_plan and fixed some lint errors (#3727) 2021-02-25 07:46:11 +00:00
test_applicationautoscaling Remove redundant test code (#3640) 2021-01-31 12:21:24 +00:00
test_athena Linting 2020-11-11 15:55:37 +00:00
test_autoscaling Improve autoscaling:CreateLaunchConfiguration request validation (#3687) 2021-02-14 11:38:03 +00:00
test_awslambda Assume synchronous Lambda invocation by default (#3615) 2021-01-26 13:28:01 +00:00
test_batch Fix Race Condition in batch:SubmitJob (#3480) 2020-11-18 10:49:25 +00:00
test_cloudformation adding physical_resource_id in SubnetRouteTableAssociation, Route and NatGW classes (#3789) 2021-03-20 08:57:53 +00:00
test_cloudwatch Tech debt (#3653) 2021-02-02 16:31:26 +00:00
test_codecommit Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
test_codepipeline Linting 2020-11-11 15:55:37 +00:00
test_cognitoidentity Fix ResourceNotFoundError exception message (#3582) 2021-01-10 13:26:40 +00:00
test_cognitoidp Cognito IdP: Raise UsernameExistsException from sign_up when user exists (#3765) 2021-03-16 22:22:53 +00:00
test_config Linting 2020-11-11 15:55:37 +00:00
test_core Fix AttributeNames for sqs.receive_message (#3736) 2021-03-05 10:42:07 +00:00
test_datapipeline Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_datasync Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
test_dynamodb Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_dynamodb2 Improve dynamodb query case sensitivity (#3799) (#3800) 2021-03-25 20:22:36 +00:00
test_dynamodbstreams Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_ec2 Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817) 2021-03-31 19:33:36 +01:00
test_ec2instanceconnect Improve implementation coverage (and layout) 2020-05-12 14:58:35 +01:00
test_ecr Remove redundant test code (#3640) 2021-01-31 12:21:24 +00:00
test_ecs Add the status field to ECS task definitions (#3723) 2021-02-24 13:26:26 +00:00
test_elasticbeanstalk Refactor ARNs to remove hardcoded account id (#3701) 2021-02-17 09:06:22 +00:00
test_elb Address pytest warnings (#3629) 2021-01-29 11:31:56 +00:00
test_elbv2 (fix) Fixes #3648 (#3649) 2021-02-02 15:21:16 +00:00
test_emr Fix: EMR ReleaseLabel validation does not respect semantic versioning (#3489) 2020-11-22 18:54:59 +00:00
test_events Add events target integration for sqs queue (#3815) 2021-03-30 14:13:10 +01:00
test_forecast Linting 2020-11-11 15:55:37 +00:00
test_glacier Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_glue Implement full Database object for Glue get_database() - fix for #3571. (#3572) 2021-01-11 13:10:18 +00:00
test_iam MaxSessionDuration should be included in the list_roles response (#3750) 2021-03-10 08:49:50 +00:00
test_iot Fix: IoT does not work in server mode (#3644) 2021-02-01 13:15:57 +00:00
test_iotdata Fix: IoT does not work in server mode (#3644) 2021-02-01 13:15:57 +00:00
test_kinesis Fix: ApproximateArrivalTimestamp should be epoch with millisecond precision (#3764) 2021-03-11 08:54:21 +00:00
test_kinesisvideo Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_kinesisvideoarchivedmedia Linting 2020-11-11 15:55:37 +00:00
test_kms Remove redundant test code (#3640) 2021-01-31 12:21:24 +00:00
test_logs Linting 2020-11-11 15:55:37 +00:00
test_managedblockchain Linting 2020-11-11 15:55:37 +00:00
test_mediaconnect Implements core MediaConnect endpoints (#3718) 2021-02-25 16:07:26 +00:00
test_medialive Implementation of core AWS Mediapackage endpoints (#3762) 2021-03-12 14:56:25 +00:00
test_mediapackage Implementation of core AWS Mediapackage endpoints (#3762) 2021-03-12 14:56:25 +00:00
test_opsworks Address pytest warnings (#3629) 2021-01-29 11:31:56 +00:00
test_organizations adding list_create_account_status to organization #3691 (#3692) 2021-02-15 11:39:23 +00:00
test_packages Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_polly Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_ram Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
test_rds Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_rds2 Minor RDS Clean up (#3682) 2021-02-13 11:12:02 +00:00
test_redshift Fix:Add functionality authorize-cluster-security-group-ingress (#3742) 2021-03-10 08:46:13 +00:00
test_resourcegroups Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
test_resourcegroupstaggingapi Add ResourceGroupsTaggingAPI Support for RDS Resources (#3674) 2021-02-11 15:15:24 +00:00
test_route53 DNSName key retrieval for list-hosted-zones-by-dns-name (#3774) 2021-03-16 12:58:16 +00:00
test_s3 Check S3_IGNORE_SUBDOMAIN_BUCKETNAME environment variable (#3796) 2021-03-26 16:51:19 +00:00
test_s3bucket_path Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
test_sagemaker Tech debt (#3653) 2021-02-02 16:31:26 +00:00
test_secretsmanager Secrets manager untag resource (#3767) 2021-03-12 10:35:38 +00:00
test_ses Raise TemplateDoesNotExist if template does not exist (#3784) 2021-03-19 15:36:53 +00:00
test_sns Update SNS get_endpoint_attributes response for Not Found endpoints (#3637) 2021-01-31 12:29:10 +00:00
test_sqs Fix AttributeNames for sqs.receive_message (#3736) 2021-03-05 10:42:07 +00:00
test_ssm Modify SSM put_parameter() to raise ValidationException if value is empty string (#3806) 2021-03-28 14:45:57 +01:00
test_stepfunctions Update integration test to use Pytest (#3703) 2021-02-17 15:06:31 +00:00
test_sts Enable AWSLambda and STS mocking for AWS China regions/endpoints (#3574) 2021-01-08 14:22:12 +00:00
test_support Support - Allow describe_cases without any params (#3818) 2021-03-31 13:18:46 +01:00
test_swf Fix heartbeatTimeout of NONE and polling responses when there are no tasks (#3680) 2021-02-12 13:01:42 +00:00
test_transcribe Linting 2020-11-11 15:55:37 +00:00
test_utilities Support Podman for mocking Lambda (#3702) 2021-02-18 08:58:20 +00:00
test_xray Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00
__init__.py Address pytest warnings (#3629) 2021-01-29 11:31:56 +00:00
compat.py Check S3_IGNORE_SUBDOMAIN_BUCKETNAME environment variable (#3796) 2021-03-26 16:51:19 +00:00
helpers.py Port test suite from nose to pytest. 2020-11-10 08:23:44 +01:00