diff options
author | Frederick Muriuki Muriithi | 2024-12-09 12:03:24 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-12-09 12:03:24 -0600 |
commit | 48ee2d70bf31d576f87e6a02498b135f96591ed4 (patch) | |
tree | 95a4e92f252457eb37086b6c7481038ee88da2e7 /tests | |
parent | d8eb7c2d983f4b7382db47c384bc673baccd170c (diff) | |
download | gn-libs-48ee2d70bf31d576f87e6a02498b135f96591ed4.tar.gz |
Parse SSL options for the connection string.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_mysqldb.py | 16 |
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""" |