2017-05-11 01:58:42 +00:00
|
|
|
import boto3
|
2021-10-18 19:44:29 +00:00
|
|
|
import sure # noqa # pylint: disable=unused-import
|
2021-11-04 22:39:53 +00:00
|
|
|
import pytest
|
2015-01-09 03:18:06 +00:00
|
|
|
|
2022-01-18 15:18:57 +00:00
|
|
|
from moto import mock_rds
|
2015-01-09 03:18:06 +00:00
|
|
|
|
|
|
|
|
2021-11-04 22:39:53 +00:00
|
|
|
def test_deprecation_warning():
|
|
|
|
with pytest.warns(None) as record:
|
|
|
|
mock_rds()
|
|
|
|
str(record[0].message).should.contain(
|
|
|
|
"Module mock_rds has been deprecated, and will be repurposed in a later release"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2017-05-11 01:58:42 +00:00
|
|
|
@mock_rds
|
|
|
|
def test_get_databases_paginated():
|
2019-10-31 15:44:26 +00:00
|
|
|
conn = boto3.client("rds", region_name="us-west-2")
|
2017-05-11 01:58:42 +00:00
|
|
|
|
|
|
|
for i in range(51):
|
2019-10-31 15:44:26 +00:00
|
|
|
conn.create_db_instance(
|
|
|
|
AllocatedStorage=5,
|
|
|
|
Port=5432,
|
|
|
|
DBInstanceIdentifier="rds%d" % i,
|
|
|
|
DBInstanceClass="db.t1.micro",
|
|
|
|
Engine="postgres",
|
|
|
|
)
|
2017-05-11 01:58:42 +00:00
|
|
|
|
|
|
|
resp = conn.describe_db_instances()
|
|
|
|
resp["DBInstances"].should.have.length_of(50)
|
2019-10-31 15:44:26 +00:00
|
|
|
resp["Marker"].should.equal(resp["DBInstances"][-1]["DBInstanceIdentifier"])
|
2017-05-11 01:58:42 +00:00
|
|
|
|
|
|
|
resp2 = conn.describe_db_instances(Marker=resp["Marker"])
|
|
|
|
resp2["DBInstances"].should.have.length_of(1)
|