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:
Jorge Rodriguez (A.K.A. Tiriel) 2021-03-16 10:15:19 +02:00 committed by GitHub
parent a5ee4b3d1a
commit 11958ec46a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 162 additions and 92 deletions

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from ansible_collections.community.mysql.plugins.module_utils.implementations.mariadb.replication import uses_replica_terminology
from ..utils import dummy_cursor_class
@pytest.mark.parametrize(
'f_output,c_output,c_ret_type',
[
(False, '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_uses_replica_terminology(f_output, c_output, c_ret_type):
cursor = dummy_cursor_class(c_output, c_ret_type)
assert uses_replica_terminology(cursor) == f_output