2022-05-11 09:15:28 +00:00
|
|
|
import json
|
2015-01-09 03:18:06 +00:00
|
|
|
import moto.server as server
|
2022-03-09 11:05:18 +00:00
|
|
|
import sure # noqa # pylint: disable=unused-import
|
2015-01-09 03:18:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_list_databases():
|
|
|
|
backend = server.create_backend_app("rds")
|
|
|
|
test_client = backend.test_client()
|
|
|
|
|
2019-10-31 15:44:26 +00:00
|
|
|
res = test_client.get("/?Action=DescribeDBInstances")
|
2015-01-09 03:18:06 +00:00
|
|
|
|
|
|
|
res.data.decode("utf-8").should.contain("<DescribeDBInstancesResult>")
|
2022-05-11 09:15:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_create_db_instance():
|
|
|
|
backend = server.create_backend_app("rds")
|
|
|
|
test_client = backend.test_client()
|
|
|
|
|
|
|
|
body = {
|
|
|
|
"DBInstanceIdentifier": "hi",
|
|
|
|
"DBInstanceClass": "db.m4.large",
|
|
|
|
"Engine": "aurora",
|
|
|
|
"StorageType": "standard",
|
|
|
|
"Port": 3306,
|
|
|
|
}
|
|
|
|
res = test_client.post("/?Action=CreateDBInstance", data=json.dumps(body))
|
|
|
|
|
2022-05-25 09:21:03 +00:00
|
|
|
response = res.data.decode("utf-8")
|
|
|
|
response.shouldnt.contain("<DBClusterIdentifier>")
|
|
|
|
|
|
|
|
# We do not pass these values - they should default to false
|
|
|
|
response.should.contain("<MultiAZ>false</MultiAZ>")
|
|
|
|
response.should.contain(
|
|
|
|
"<IAMDatabaseAuthenticationEnabled>false</IAMDatabaseAuthenticationEnabled>"
|
|
|
|
)
|