From 48ee2d70bf31d576f87e6a02498b135f96591ed4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 9 Dec 2024 12:03:24 -0600 Subject: Parse SSL options for the connection string. --- tests/unit/test_mysqldb.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') 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""" -- cgit v1.2.3