about summary refs log tree commit diff
path: root/tests/unit/test_mysqldb.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-12-09 12:03:24 -0600
committerFrederick Muriuki Muriithi2024-12-09 12:03:24 -0600
commit48ee2d70bf31d576f87e6a02498b135f96591ed4 (patch)
tree95a4e92f252457eb37086b6c7481038ee88da2e7 /tests/unit/test_mysqldb.py
parentd8eb7c2d983f4b7382db47c384bc673baccd170c (diff)
downloadgn-libs-48ee2d70bf31d576f87e6a02498b135f96591ed4.tar.gz
Parse SSL options for the connection string.
Diffstat (limited to 'tests/unit/test_mysqldb.py')
-rw-r--r--tests/unit/test_mysqldb.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/test_mysqldb.py b/tests/unit/test_mysqldb.py
index 793dc1d..df8fd49 100644
--- a/tests/unit/test_mysqldb.py
+++ b/tests/unit/test_mysqldb.py
@@ -62,6 +62,22 @@ def test_database_connection(mock_db_parser, mock_sql):
           "user": None,
           "password": None,
           "database": "users"
+      }),
+     (("mysql://localhost/users?ssl=key;keyname,cert;/path/to/cert,ca;caname,"
+       "capath;/path/to/certificate/authority/files,cipher;ciphername"),
+      {
+          "host": "localhost",
+          "port": 3306,
+          "user": None,
+          "password": None,
+          "database": "users",
+          "ssl": {
+              "key": "keyname",
+              "cert": "/path/to/cert",
+              "ca": "caname",
+              "capath": "/path/to/certificate/authority/files",
+              "cipher": "ciphername"
+          }
       })))
 def test_parse_db_url(sql_uri, expected):
     """Test that valid URIs are passed into valid connection dicts"""