Fix:RDS:add DBParameterGroupArn in describe-db-parameter-groups & cre… (#3462)

* Fix:RDS:add DBParameterGroupArn in describe-db-parameter-groups & create-db-parameter-group

* Test change

* Fixed tests

* tests change acconutID

* linting

Co-authored-by: usmankb <usman@krazybee.com>
This commit is contained in:
usmangani1 2020-12-02 01:23:01 +05:30 committed by GitHub
commit b2adcdf518
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 6 deletions

View file

@ -4,6 +4,7 @@ from botocore.exceptions import ClientError, ParamValidationError
import boto3
import sure # noqa
from moto import mock_ec2, mock_kms, mock_rds2
from moto.core import ACCOUNT_ID
@mock_rds2
@ -1504,7 +1505,9 @@ def test_create_database_with_encrypted_storage():
@mock_rds2
def test_create_db_parameter_group():
conn = boto3.client("rds", region_name="us-west-2")
region = "us-west-2"
pg_name = "test"
conn = boto3.client("rds", region_name=region)
db_parameter_group = conn.create_db_parameter_group(
DBParameterGroupName="test",
DBParameterGroupFamily="mysql5.6",
@ -1518,6 +1521,9 @@ def test_create_db_parameter_group():
db_parameter_group["DBParameterGroup"]["Description"].should.equal(
"test parameter group"
)
db_parameter_group["DBParameterGroup"]["DBParameterGroupArn"].should.equal(
"arn:aws:rds:{0}:{1}:pg:{2}".format(region, ACCOUNT_ID, pg_name)
)
@mock_rds2
@ -1629,9 +1635,11 @@ def test_create_db_parameter_group_duplicate():
@mock_rds2
def test_describe_db_parameter_group():
conn = boto3.client("rds", region_name="us-west-2")
region = "us-west-2"
pg_name = "test"
conn = boto3.client("rds", region_name=region)
conn.create_db_parameter_group(
DBParameterGroupName="test",
DBParameterGroupName=pg_name,
DBParameterGroupFamily="mysql5.6",
Description="test parameter group",
)
@ -1639,6 +1647,9 @@ def test_describe_db_parameter_group():
db_parameter_groups["DBParameterGroups"][0]["DBParameterGroupName"].should.equal(
"test"
)
db_parameter_groups["DBParameterGroups"][0]["DBParameterGroupArn"].should.equal(
"arn:aws:rds:{0}:{1}:pg:{2}".format(region, ACCOUNT_ID, pg_name)
)
@mock_rds2