eskarimov commented on code in PR #24099:
URL: https://github.com/apache/airflow/pull/24099#discussion_r892494193
##########
tests/providers/amazon/aws/operators/test_rds.py:
##########
@@ -450,3 +452,69 @@ def test_delete_event_subscription(self):
with pytest.raises(self.hook.conn.exceptions.ClientError):
self.hook.conn.describe_event_subscriptions(SubscriptionName=EXPORT_TASK_NAME)
+
+
[email protected](mock_rds is None, reason='mock_rds package not present')
+class TestRdsCreateDbInstanceOperator:
+ @classmethod
+ def setup_class(cls):
+ cls.dag = DAG('test_dag', default_args={'owner': 'airflow',
'start_date': DEFAULT_DATE})
+ cls.hook = RdsHook(aws_conn_id=AWS_CONN, region_name='us-east-1')
+
+ @classmethod
+ def teardown_class(cls):
+ del cls.dag
+ del cls.hook
+
+ @mock_rds
+ def test_create_db_instance(self):
+ create_db_instance_operator = RdsCreateDbInstanceOperator(
+ task_id='test_create_db_instance',
+ db_instance_identifier=DB_INSTANCE_NAME,
+ db_instance_class="db.m5.large",
+ engine="postgres",
+ rds_kwargs={
+ "DBName": DB_INSTANCE_NAME,
+ },
Review Comment:
In case with Postgres it's different parameters - `db_instance_identifier`
identifies the DB instance, while `DBName` is the name of the database to
create when the DB instance is created.
We can actually omit `DBName`, then a database named `postgres` is created
in the DB instance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]