From 8be1d5f731197fd3aa289dbde43a4c857e5a6304 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Mon, 27 Jan 2025 12:14:59 -0800 Subject: [PATCH] address codeQL warnings --- test/unit/objects/database_test.py | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/test/unit/objects/database_test.py b/test/unit/objects/database_test.py index d3546562..150113c0 100644 --- a/test/unit/objects/database_test.py +++ b/test/unit/objects/database_test.py @@ -112,13 +112,16 @@ def test_create(self): with self.mock_post("/databases/mysql/instances") as m: # We don't care about errors here; we just want to # validate the request. - self.client.database.mysql_create( - "cool", - "us-southeast", - "mysql/8.0.26", - "g6-standard-1", - cluster_size=3, - ) + try: + self.client.database.mysql_create( + "cool", + "us-southeast", + "mysql/8.0.26", + "g6-standard-1", + cluster_size=3, + ) + except Exception as e: + logger.warning("An error occurred while validating the request: %s", e) self.assertEqual(m.method, "post") self.assertEqual(m.call_url, "/databases/mysql/instances") @@ -292,13 +295,16 @@ def test_create(self): with self.mock_post("/databases/postgresql/instances") as m: # We don't care about errors here; we just want to # validate the request. - self.client.database.mysql_create( - "cool", - "us-southeast", - "mysql/8.0.26", - "g6-standard-1", - cluster_size=3, - ) + try: + self.client.database.postgresql_create( + "cool", + "us-southeast", + "postgresql/13.2", + "g6-standard-1", + cluster_size=3, + ) + except Exception: + pass self.assertEqual(m.method, "post") self.assertEqual(m.call_url, "/databases/postgresql/instances")