mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
Handle divergences between MySQL and MariaDB (#103)
* Initial attempt * First functional approach * Remove unused imports * Add dychotomy handling for mysql_replication * Fix cursor lookup * Fix sanity tests * Cleanup implementation conditional import * Fix unit tests * Fix conditional import to satisfy both sanity and integration tests * Add changelog fragment
This commit is contained in:
parent
a5ee4b3d1a
commit
11958ec46a
12 changed files with 162 additions and 92 deletions
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.mysql.plugins.module_utils.implementations.mariadb.user import (
|
||||
supports_identified_by_password,
|
||||
)
|
||||
from ..utils import dummy_cursor_class
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'function_return,cursor_output,cursor_ret_type',
|
||||
[
|
||||
(True, '10.5.0-mariadb', 'dict'),
|
||||
(True, '10.5.1-mariadb', 'dict'),
|
||||
(True, '10.6.0-mariadb', 'dict'),
|
||||
(True, '11.5.1-mariadb', 'dict'),
|
||||
]
|
||||
)
|
||||
def test_supports_identified_by_password(function_return, cursor_output, cursor_ret_type):
|
||||
"""
|
||||
Tests whether 'CREATE USER %s@%s IDENTIFIED BY PASSWORD %s' is supported,
|
||||
which is currently supported by everything besides MySQL >= 8.0.
|
||||
"""
|
||||
cursor = dummy_cursor_class(cursor_output, cursor_ret_type)
|
||||
assert supports_identified_by_password(cursor) == function_return
|
Loading…
Add table
Add a link
Reference in a new issue