def test_stop_db_instance_snapshot(aws_client): client = MagicMock() aws_client.return_value = client db_id = 'some-rds-instance-identifier' ss_id = 'some-rds-snapshot-identifier' stop_db_instance(db_instance_identifier=db_id, db_snapshot_identifier=ss_id) client.stop_db_instance.assert_called_with(DBInstanceIdentifier=db_id, DBSnapshotIdentifier=ss_id)
def test_stop_db_instance_exception(): with pytest.raises(TypeError) as x: stop_db_instance() assert "stop_db_instance() missing 1 required positional argument: " \ "'db_instance_identifier'" in str(x.value)
def test_stop_db_instance(aws_client): client = MagicMock() aws_client.return_value = client db_id = "some-rds-instance-identifier" stop_db_instance(db_instance_identifier=db_id) client.stop_db_instance.assert_called_with(DBInstanceIdentifier=db_id)